[ad_1]
我设计了一个引导模式弹出框,单击父页面中的按钮后将打开该弹出框。 我想在模态中执行一些操作并关闭它,但是在单击子页面上的按钮并提交模态表单后,父页面会刷新。 我尝试了 **OnClientClick=”return false;”** 但它停止触发按钮事件。
谁能告诉我如何解决
**代码**
**父页面**
超文本标记语言
<a href=\"/abcd/abcd1/abcd2.aspx?abcd3=" + Eval("abcd4") + "&abcd5=" + Eval("abcd6") + "&abcd7=" + Eval("abcd7") + "&abcd8=" + Eval("abcd8") + "\" class='li-modal'>"+ Eval("abcd9") + "</a>
**子页面**
网络平台
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" > <title>ABCDEF</title> <script language="javascript" type="text/javascript" src="/abcdef/xyzed/Script.js"></script> </head> <body scroll="no"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">X</button> </div> <div class="modal-body" style="margin-left:-140px;"> <div class="panel panel-default"> <div class="panel-body"> <form id="form1" runat="server"> <table class="inputForm" cellspacing="0" cellpadding="0" border="0" style="width: 100%; height: 100%; table-layout: fixed"> <thead> <tr height="18"> <td>ABCDEF Order</td> </tr> </thead> <tfoot> <tr> <td style="vertical-align: middle"> <table> <tfoot> <tr> <td>XYZED no:</td> <td> <asp:TextBox ID="No" runat="server" Width="50px" EnableViewState="False" /> </td> <td> <asp:Button ID="xyz1" runat="server" Text="|<" OnClick="xyz1_Click" autopostback="false"/> <asp:Button ID="xyz2" runat="server" Text="<" OnClick="xyz2_Click" OnClientClick="return false;" /> <asp:Button ID="xyz3" runat="server" Text=">" OnClick="xyz3_Click" OnClientClick="return false;" /> <asp:Button ID="xyz4" runat="server" Text=">|" OnClick="xyz4_Click" OnClientClick="return false;" /> </td> </tr> </tfoot> </table> </td> </tr> <tr class="footerrow" height="24"> <td align="right"> <asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Ok" OnClick="btnSubmit_Click"> </asp:Button><input class="button" id="btnCancel" onclick=" top.window.close();" type="button" value="Cancel" name="btnCancel" /></td> </tr> </tfoot> </table> </form> </div> </div> <div class="modal-footer"> </div> </div> </body> </html> </asp:Content>
**Childpage.cs**
C#
protected void Page_Load(object sender, EventArgs e) { No = long.Parse(Request.QueryString["No"]); RuleNo = long.Parse(Request.QueryString["RuleNo"]); if (!IsPostBack) { No.Text = ((long)oldRuleNo).ToString(); } } protected void xyz1_Click(object sender, EventArgs e) { No.Text = "1"; }
点击xyz1_Click按钮后父页面刷新。 我该如何阻止它。 请帮忙