try:
window.parent.returnValue=document.Form2.TextBox1.value;

解决方案 »

  1.   

    opener.returnValue=document.Form2.TextBox1.Text ;
    opener.close();
      

  2.   

    <body MS_POSITIONING="GridLayout">
    <script language="javascript">
    function a()
    {
          window.parent.returnValue=document.Form2.TextBox1.Text ;
          window.parent.close();
    }
    </script>
    <form id="Form2" method="post" runat="server">
    <asp:label id="Label1" runat="server">请输入您的大名:</asp:label><br>
    <br>
    <asp:textbox id="TextBox1" runat="server" Width="558"></asp:textbox><br>
    <br>
    <input type=button onclick="a()" value=" 提  交 "></form>
    </body>
      

  3.   

    可参考
    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  4.   

    net_lover(孟子E章) 
    你给的代码跟我的一样啊。我这是在aspx文件里写的javascript他说TextBox不存在
      

  5.   

    net_lover(孟子E章) 
    我是根据你哪个该成c#代码的。你用的是在aspx.vb的page_load注册客户段代码,但是我不知道
    C#怎么写,我就他他直接潜入到aspx里。
      

  6.   

    这个是调用弹出菜但哪个窗体
    <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="showModalDialog.WebForm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1</title>
    </HEAD>
    <BODY>
    <script language="javascript">
    function OpenWin()
    {
    var str=window.showModalDialog('WebForm2.aspx',window.Form1.TextBox1.Value);
        if(str!=undefined)
    { document.Form1.TextBox.value=str;

         
    }
    }
    </script>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <form id="Form1" method="post" runat="server">
    <asp:label id="Label1" runat="server" Font-Bold="true">
    从当前页面打开新窗口,并把变量传递到新窗口的例子,可以多次打开提交。
    </asp:label><br>
    <br>
    <asp:textbox id="TextBox1" runat="server" Width="600px">这是初始值,将被传递到新窗口。</asp:textbox><br>
    <br>
    <asp:button id="Button1" runat="server" Text="打开窗口" Width="96px"></asp:button>
    </form>
    </BODY>
    </HTML>