ASP.NET 当前界面弹出另一个界面后,点击弹出界面的按钮又重新生成一个弹出界面的解决办法。。
模态窗口弹出界面:
var f_url = "SCYY.aspx"; window.showModalDialog(f_url, window, 'dialogwidth:450px;dialogheight=210px;toolbar=no,menubar=no,scrollbars=yes,resizeable=no,location=no,status=no,titlebar=no,directories=no');
弹出界面的HTML:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCYY.aspx.cs" Inherits="AnyOffice.general.FW_ZCGL.SCYY" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <base target="_self"></base> <title>删除原因</title> <script language="javascript" type="text/javascript"> function callParent() { //window.opener.toUpdate_nr(); window.close(); } </script> </head> <body class="bodycolor" > <form id="form1" runat="server"> <div> <table width="100%" class="small" cellspacing="1" cellpadding="3" align="center" border="0"> <tr> <td class="TableHeader" width="100%"> <img src="/images/green_arrow.gif" align="absMiddle"> 请填写删除原因: </td> </tr> <tr> <td width="100%"> <asp:TextBox runat="server" CssClass="BigInput" ID="tbyy" Width="100%" Height="140px" TextMode="MultiLine"></asp:TextBox> </td> </tr> <tr> <td colspan="2" align="center"> <asp:Button ID="btn_sbmit" runat="server" Text="提交" OnClick="btn_sbmit_Click" class="SmallButton" /> <asp:Button ID="btn_clear" runat="server" Text="清除" OnClick="btn_clear_Click" class="SmallButton" /> </td> <td> </td> </tr> </table> </div> </form> </body> </html>
解决的办法是 加上 这句话:<base target="_self"></base>