在弹出的模式窗口中点save close,关闭窗口,同时保存数据并刷新父窗口,应该如何实现?

解决方案 »

  1.   

    父页面打开子页面里加上if(false!=window.showModalDialog(新页面))
                {
                    this.location.href=this.location;
                 }
      

  2.   

    父:
    function OpenModalDialog()
    {
    var recdata=false;
    try
    {
    recdata=showModalDialog("ShareSoftWareAuditingUpdate.aspx","newwindow","dialogHeight:600px;dialogWidth:800px; dialogTop:screen.height/4;dialogLeft:screen.width/4; edge:sunken ; center: Yes; help: No; resizable: No; status: No; scroll:yes;");
        if(recdata==true)
        {
         // 刷新当前窗口
       window.location.href =window.location.href;
              window.location.href.reload();
       
        }
    } catch(err)
    {}
    }子:
    在保存操作加:
    string strScript = @"<script>window.returnValue=true;window.close();</script>";
     this.Response.Write(strScript);
      

  3.   

    我想要实现的是模式窗口关闭后,父窗口再重新加载,因为有些数据已经在模式窗口中保存后改变了,4楼的意思是正确的,但代码有问题,没有实现
    string strScript = @" <script>window.returnValue=true;window.close(); </script>"; 点保存后,主窗口中得不到返回值
      

  4.   

    父窗体 var a = showModalDialog(xx);
    子窗体 return xx;