父子页面,有关弹框问题
1.引用
1 <script type="text/javascript" src="../Library/jquery-ui-1.9.2.custom.js"></script> 2 <link href="../Styles/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" />
2.onclike事件:js 父窗口弹出子窗口
1 function checkConfirmItem(obj){ 2 var Item=obj.id; 3 var num = $.trim(Item.replace("gvEditConfirm_btnItem_", "")); 4 var hd=$("#gvEdit_hdCItem_" + num).val(); 5 var page="confirm"; 6 var strLink = "TMSOrder_Item.aspx?num=" + num + " &hd= " + hd + " &page= " + page; 7 $("<div id='winPrint'><iframe id='iPrint' frameborder='0' src='{0}' style='width:100%;height:100%;'></iframe></div>".format(strLink)).dialog({ 8 autoOpen: true, 9 title: "", 10 height: 550, 11 position: 'center', 12 width: 1000, 13 modal: true, 14 close: function () { } 15 }); 16 }
3.若子窗口有按钮作用是:点击后子窗口关闭,需在父窗口写 js
1 function closeaddiframe(arr) { 2 $("#winPrint").remove(); 3 }
并在子窗口添加js
1 function GetBack() { 2 window.parent.closeaddiframe(); 3 }
4.可能会出现弹框一闪的情况,解决如下
<asp:Button runat="server" ID="btnC_Back" Text="<%$Resources:GlobalResource,gr_Back %>" UseSubmitBehavior="false" OnClientClick="if(!GetBack()){return false;}" />