如何取得window.returnValue中的值??

解决方案 »

  1.   

    var w = window.showModalDialog(url);
    alert(w)w即是上面打开页面设置的returnValue
      

  2.   

    var w = window.showModalDialog(url);
    document.getElementById("TextBoxId").value = w;
      

  3.   

    var w = window.showModalDialog(url);
    document.getElementById("id").value=w;
      

  4.   

    1.aspx<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <input id="Button3" type="button" name="submit"  value="button" onclick ="SelectClass()" />
    <script language="JavaScript" type ="text/javascript"  >
    function SelectClass()
    {
    var myWin;
    myWin=window.showModalDialog("2.aspx", "dialogWidth=300px;dialogHeight=400px"); 
    document.getElementById ("TextBox1").value=myWin;
    }
    </script>===================
    2.aspx
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click1" Text="Button" />
    <input id="Button1" type="button" value="确定" onclick ="javascript:self.close();"/>
    ---------------------------------------
    protected void Button2_Click1(object sender, EventArgs e)
        {
            this.TextBox1.Text = "wwwwww";
            Response.Write("<script   language='javascript'>window.returnValue='wwwww'</script>");
        }
    1.aspx中的texBox1没得到值
      

  5.   

    看看能不能alert吧
     
    Response.Write("<script   language='javascript'>alert('wwwww');window.returnValue='wwwww'</script>");
      

  6.   

    2.aspx中加上<body onunload="window.returnValue='xxxxxx'">