有两个页面A.aspx和B.aspx,
A里有一个按钮和一个文本框,
B里有一个按钮,
要实现:
1,打开A.aspx
2,点A.aspx里的按钮弹出新窗口B.aspx
3,接下来点击B.aspx中的按钮后看到之前打开的那个A.aspx页面中的文本框自动显示为“aaa”
请高手给个代码
注:第3步用C#,不用javascript

解决方案 »

  1.   

    1.自己打开
    2.<input type=text id="txt1" /><input type=button onclick="window.open('b.aspx');" value=button />
      自已按
    3.Page_Load(...)
    {
    Response.Write("<script>window.opener.document.getElementById('txt1').value='aaa';</script>");
    }
      

  2.   

    这个就是弹出对话框关闭后刷新父窗口嘛,归到底还是用JS好
    <script language="javascript">
        <!--
            setTimeout("s()",3000)
            function s()
            {
              window.opener.location.reload();   
              window.close();
            }
        -->
    </script> 
      

  3.   

    楼主这样的白痴要求也就只能用response.Write点javascript来蒙蒙他了
      

  4.   

    http://download.csdn.net/source/711869
      

  5.   


    B.aspx按钮事件
    {
        Response.Redirct("A.aspx?str=aaa");
    }A.aspx 页面
    Page_Load(....)

       if(Request["str"]!=null)
       {
           文本框.Text= "aaa";
       }
    }// 或是B.aspx按钮事件
    {
        Response.Redirct("A.aspx?IsSend=yes");
    }A.aspx 页面
    Page_Load(....)

       if(Request["IsSend"]!=null)
       {
           if(Request["IsSend"]=="yes")
           {
                文本框.Text= "aaa";
           }
       }
    }
      

  6.   

    1.打开,打开浏览器
    2.弹出B
    window.open("B.aspx");3.不管你用C#还是什么,归根结底都是用的js代码来实现的
    page.RegisterClientScript("<script >window.opener.document.getElementById(\"textbox1\").value='"+value+"';</script>")
      

  7.   

     Response.Redirct("A.aspx?str=这里传值");另一个页面加载时用Request来接Response.Write(" <script>window.opener.document.getElementById('txt1').value='aaa'; </script>"); 
    这个方法好些
      

  8.   

    本质上还得用JAVASCRIPT吗?
    我以这Control对象里面的Parent属性跟这个有关呢,就是不知道怎么用
      

  9.   

    Control的Parent是父控件,不是父页面