首先,A页面利用按钮打开B页面
function SelectUnit() { OpenDialogBox(epoint.url.getAbsoluteUrl("PK_UserSelect.aspx"), '', "选择人员", AfterOpen, 800, 800); }
在这个方法中调用afateropen 方法,A页面前台页面绑定B页面传过来的json值
function AfterOpen(rtnStr) { var json = rtnStr; $("[id$='txtName']").val(json.Name); $("[id$='User']").val(json.RowGuid); $("[name=rbn_list]").eq(1).prop("checked", "true"); if (json.Sex == 0) { $("[id$='txtSex']").val("男"); } else { $("[id$='txtSex']").val("女"); } $("[id$='txtDanWeiName']").val(json.DanWeiName); $("[id$='txtIdentityNum']").val(json.IdentityNum); }
在B页面中,datagird绑定调用jquery
<epoint:TemplateColumn HeaderText="选择"> <ItemStyle HorizontalAlign="Center" /> <ItemTemplate> <input type="radio"RowGuid")%> ','<%#DataBinder.Eval(Container.DataItem,"Name")%> ','<%#DataBinder.Eval(Container.DataItem,"Sex")%> ','<%#DataBinder.Eval(Container.DataItem,"DanWeiName")%> ','<%#DataBinder.Eval(Container.DataItem,"IdentityNum")%> ')" value="确认选择" /> </ItemTemplate> </epoint:TemplateColumn> function ReturnDJH(RowGuid,Name,Sex,DanWeiName,IdentityNum) { var json={ 'RowGuid':RowGuid,'Name':Name,'Sex':Sex,'DanWeiName':DanWeiName,'IdentityNum':IdentityNum }; CloseParentDialogBox(json);//关闭页面传值 }