Response.Write("<script language=javascript>window.opener.location=window.opener.location.href;window.close();</script>");

解决方案 »

  1.   

    可以用Session试试,第二页面添加Session.Add("value", "data");
    第一页面
    if (Session["value"] != null)
    {
    TextBox.Text = (string)(Session["value"]);
    }
      

  2.   

    b 页面中去掉opener =null 而且你不能写在服务器提交事件中,它是不会提交的,模式窗口会在另外一个窗口进行提交,所以你会看见b页面闪了一下,然后关闭。实际上是创建了另外一个b页面,并关闭了。
    解决方法://js把你的服务器端按钮写成html按钮事件,执行返回值和关闭。
      

  3.   

    要想在b页面中进行提交服务器事件,需要使用Iframe .
    // 写一个C 页面,让a页面中弹出c页面// Page:c.html<html>
    <body>
    <Iframe src="b.aspx" width="100%" height="100%"></iframe>
    </body>
    </html>
      

  4.   

    <input type="button" value="按钮" onclick="DoClick();">function DoClick()
    {
       var GetValue = null;
           GetValue = showModalDialog(......);   document.getElementById("InputBox") = GetValue;
    }B页面:
    private void BtnDetailUpdate_Click(object sender, System.EventArgs e)
    {
      //关闭窗体;涮新FrmSale.aspx
      Response.Write("<script language='javascript'>window.returnValue="YourValue";window.close();</script>");
    }
      

  5.   

    showModalDialog要返回值,必须一个窗体容器的
      

  6.   

    就得用SESSION,用购物车的原理
      

  7.   

    先道谢各位!偶在.net 2003环境下
     reaperwu(RQ) :
    偶就是看了你以前回答的问题,你现在的答案:
    B页面:BtnDetailUpdate应是一服务器端控件吧
    问题仍在: 关闭不了第二页,只不过闪一下,还在第二页  
    Seeko0(阿 枫) :
      正在试,能够详细的代码吗?
      

  8.   

    第一个页面没错;
    第二个页面文件中:
    <input type=button ID=btn_Return value= "确 定" onclick="ReturnTemplet();">
    function ReturnTemplet()
    {
    window.parent.returnValue=document.Form1.tb_Templet.value;
    window.close();
    }
      

  9.   

    Seeko0(阿 枫) :方法可以第二个页面中要处理服务器端控件。