注意,这会不是showModalDialog的答案。比如我在弹出的窗口中有一个有个GridView,是放员工信息,其中有一模板列,用于选择那些人,选中后如何返回这些信息给主调用窗口?返回的是gridView的行的内容。我想过用JAVASCRIPT来存储行对象的内容,可不会做。就算能存储了,主页如何调用?谢谢

解决方案 »

  1.   

    window.open
    window.opener.document.getElementById("txt")
    onclick="javascript:SetValue('<%#  Eval("Id")%>','<%#Eval("Name")%>')"
      

  2.   


    这个。没注意说了,只用showModalDialog
      

  3.   

    window.opener.document.getElementById("txt")=document.getElementById("本页面ID")
      

  4.   

    弹出模态对话框 
     function openWindow(divIndex) {  
             var width = 550;  
             var height = 450;  
             var url = "child.aspx?divIndex=" + divIndex;  
             var returnVal;  
             returnVal = window.showModalDialog(url, window, 'dialogWidth=' + width + 'px;dialogHeight=' + height + 'px;resizable=no;help=no;center=yes;status=no;scroll=no;edge=sunken');                  
             if (returnVal)  //当直接点模态窗体的X关闭的时候不刷新主页面  
             {// 取得子窗口的返回值  
                  
             }  
         }
    服务器事件给模态对话框传值,不需要的话可以直接用脚本操作
     private void NoteParentToUpdate(string returnValue)  
             {  
                 StringBuilder s = new StringBuilder();  
                 s.Append("<mce:script language=javascript><!--  
     " + "\n");  
                 s.Append("window.returnValue='" + returnValue + "';" + "\n");  
                 s.Append("window.close();" + "\n");  
                 s.Append("  
     // --></mce:script>");  
                 Type cstype = this.GetType();  
                 ClientScriptManager cs = Page.ClientScript;  
                 string csname = "ltype";  
                 if (!cs.IsStartupScriptRegistered(cstype, csname))  
                 {  
                     cs.RegisterStartupScript(cstype, csname, s.ToString());  
                 }  
             }  
    具体的你可以去我博客里翻翻,前段时间做了个点击父窗体弹出子页面,子页面向父窗体传值,一步更新父窗体的东东,希望对你有用  
      

  5.   

    <mce:script  -》》》<script
      

  6.   

    window.dialogArguments.document.getElementById("processId").value=document.getElementById("t").value
    试下看看!