代码如下:
父窗体:
<script type="text/javascript">
    function AddInfo()
    {
        var result = window.showModalDialog('A.aspx','window','dialogWidth:800px;dialogHeight:510px;help:no;center:yes;resizable:no;status:no;scroll:no');
        if(result==1)
        {
            window.location.reload();
        }
    }
    </script><span onclick="AddInfo()">新 增</span>点击新增后,弹出子窗体,但子窗体返回的值父窗体不单获不到,还打开一个浏览器刚打开过的窗口,而且页面又一版空白,不加载信息,点刷新一下才开始加载.晕...子窗体用到的代码如下:
点击一个服务器控件Button执行:
this.RegisterStartupScript("x", "<script>window.returnValue=1;window.close(true);</script>");搞不明白,怎么会出现这种问题呢?不清楚JS有什么错???

解决方案 »

  1.   

    C/S的我知道,但是还真不知道怎么在B/S做,不过我知道一种方法能达到你效果,就是做一个DIV,然后在你添加完以后把这个DIV的东西刷到页面里,跟子窗体的效果差不多,而且还比较美观~~~
      

  2.   

    防止刷新时打开新窗口,只需在head中加一条:
        <base target="_self">
      

  3.   

    在弹出的窗口里面加<base target="_self">
      

  4.   

    <head runat="server">
        <title>Untitled Page</title>
        <base target="_self"> 
    </head>
      

  5.   

    介绍一种简单的做法:
    http://blog.csdn.net/downmoon/archive/2009/09/08/4530428.aspx