ASP.Net中使用模式对话框的问题:
A页面中showModalDialog B页面,在B页面中更新了数据库,当关掉B页面时,A需要自动刷新,以便反映数据库的更改。 如何做?

解决方案 »

  1.   

    A页面中:
    showModalDialog(B,"","");
    window.location.reload();脚本执行到打开模式窗口时会自动停止,等待用户相应。
    当关闭窗口之后,才会执行刷新
      

  2.   

    showModalDialog B页面中window.parent.location.reload();
    window.close();
      

  3.   

    function Openw(wurl)
    {
    var my_array = "";
    //showModelessDialog/showModalDialog
    my_array = window.showModelessDialog(wurl,window,"dialogWidth:400px;dialogHeight:300px;dialogTop:30;dialogLeft:30;help:no;status:no;");
    if(my_array=="OK")
    window.history.go(0);
    }
      

  4.   

    strReturn=window.showModalDialog("xxx.aspx", "", "");
        if (strReturn=='1'){
        window.Form1.submit();
        }
        else
        {
            ---- 
        }xxx.aspx就是你的子页面,showModalDialog关闭时就会运行if (strReturn=='1').
    子页面的程序如下: If 取消 Then
       Response.Write("<script language=""javascript"">window.close();returnValue='0'</script>")
                Else
                   ...  修改数据              
        Response.Write("<script language=""javascript"">returnValue='1';window.close();</script>")
    End If
      

  5.   

    window.opener.location.reload();
    or
    window.parent.location.reload();
    不知是那一个
    window.close();