window.showModalDialog是javascript里面的函数,这样可以达到你要的效果:
string msg="window.showModalDialog('DialogPage.aspx');";
Response.Write("<script language=javascript>"+msg+"</script>");

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/3146/3146434.xml?temp=.4011347我以前也问过.看看这个贴子吧!不知道对你有没有帮助.
      

  2.   

    window.showModalDialog("DialogPage.aspx")打开模态窗体时,在DialogPage.aspx中可以设置返回参数。但是请注意DialogPage.aspx最好为框架文件,否则使用window.close()关闭窗口可能会有问题。
    code:var retval=window.showModalDialog("DialogPage.aspx");比如DialogPage.aspx是一个框架它包括
    <frameset rows="0,*" border="0" frameSpacing="0" frameBorder="0">
    <frame name="header" src="a.aspx" scrolling="no" noresize>
    <frame name="main" src='b.aspx'>
    </frameset>
    然后在a.aspx文件中(javascript 代码)
    function btnOK_onclick() {
             //设置返回值
    top.returnValue = document.getElementById("checkedItemValue").value;
    window.close();
    }
      

  3.   

    打开:
    var return=window.showModalDialog("DialogPage.aspx",return,"width:500px;........");回传:
    window.returnValue=return;
    window.close();接收:
    if(return!=null)
    {
     document.getElementById("控件名").innerText = return;
    }
      

  4.   

    其中回传中的那个return可以为别的值。
      

  5.   

    我用的是C#,打开窗体时我用的是
    Response.Write("<script>window.open("Dialogpage.aspx")</script>");
    上面的window.showModalDialog("DialogPage.aspx",return,"width:500px;........");
    直接这样写不行的,不识别window,应该引用命名空间么?请指教?
      

  6.   

    这不是命名空间的问题,不管是window.open还是window.showModalDialog都是JS