日期:2014-05-18  浏览次数:20412 次

模式窗体下弹出两次提示错误问题!急
此帖内容前两天发过,没有得到有效回答,开新帖提问。
在打开的模式窗体中,点击服务器按钮控件,在按钮事件中写
ClientScript.RegisterStartupScript(this.GetType(),   "submitOk ",   "alert( '123 '); ",true);弹出两次提示窗体!不明白为何弹出两次,具体代码如下。
起始页为页面一TestPage.aspx
页面1:调用模式窗体的父窗体
<%@   Page   Language= "C# "   AutoEventWireup= "true "   CodeFile= "TestPage.aspx.cs "   Inherits= "htManage_TestPage "   %>

<head   runat= "server ">
        <title> 1 </title>
        <script   language= "javascript ">
          function   showErrMsg()
                {
                            window.showModalDialog( "TestPageFrame.aspx ", " ", "center=yes;dialogHeight=20;dialogWidth=20;resizable=yes;status=yes;scroll=yes;help=no ");
                }
            </script>
</head>
<body>
        <form   id= "form1 "   method= "post "   runat= "server ">
        <div>
                <input   onclick= "return   showErrMsg(); "   type= "button "   value= "保   存 "   id= "button2 "   name= "btnSave "   />
        </form>
</body>
</html>

页面2:模式窗体的加载窗体

<%@   Page   Language= "C# "   AutoEventWireup= "true "   CodeFile= "TestPageFrame.aspx.cs "   Inherits= "htManage_TestPageFrame "   %>

<head   >
        <title> 2 </title>
                <base   target= "_self "> </base>
</head>

        <frameset   rows= "0,* ">
        <frame   src= "about:blank ">
        <frame   src= "TestPage2.aspx ">
            </frameset>
</html>

页面3:   模式窗体

<%@   Page   Language= "C# "   AutoEventWireup= "true "   CodeFile= "Testpage2.aspx.cs "   Inherits= "htManage_Testpage2 "   %>

<head>
        <title> 3 </title>
        <base   target= "_self "> </base>
          <script   language= "javascript ">
        function   showErrMsg()
                {
                            window.showModalDialog( "TestPage3.aspx ", " ", "center=yes;dialogHeight=20;dialogWidth=20;resizable=yes;status=yes;scroll=yes;help=no ");
}
                </script>
</head>
&