点击A页面的button弹出一个无边框的窗口B,在B中选择复选框后,把值传回A页面中,请给出完整代码,谢谢!

解决方案 »

  1.   

    http://www.px915.com/lhgdialog/_demo.html参考……
      

  2.   

    无边框的窗口? 显示一个div, 把其它蒙住. 选择完把div隐藏, 其它显示.
      

  3.   

    var returnValue = window.showModalDialog("car.aspx?id="+srcl+"",1,"dialogwidth:720px;dialogheight:480px;help:0;center:yes;resizable:0;status:0;scroll:yes");
    if(returnValue!=""&&returnValue!=null){
    alert(returnValue);

    }
      

  4.   

    B页面返回值window.returnValue='XXX';
      

  5.   

    a.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script>
            function ShowDialog() {
                window.open("b.aspx", "", "");
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <br>
        <a href="JavaScript:ShowDialog()">test</a>
        </div>
        </form>
    </body>
    </html>b.aspx
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        
            <asp:CheckBox ID="CheckBox1" runat="server" Text="Test" />
            <asp:Button ID="Button1" runat="server"  Text="确定" 
                onclick="Button1_Click" />
        
        </div>
        </form>
    </body>
    </html>b.aspx.cs 
    protected void Button1_Click(object sender, EventArgs e)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("<script type='text/javascript'>\r\n");
            sb.Append("window.opener.form1.TextBox1.value='" + CheckBox1.Text + "';\r\n");
            sb.Append("window.close();\r\n");
            sb.Append("</script>\r\n");
            string js = sb.ToString();        Response.Write(js);
        }不行来找我!
      

  6.   

    在一个窗体中使用JS+DIV也可啊
      

  7.   

    能具体点吗?最好有完整的代码,本人对JavaScript不是很熟悉,谢谢
      

  8.   

    ''类库
    <Serializable()> _
    Public NotInheritable Class UICBase''方法:   
     Public Shared Sub OpenPage(ByVal pageName As String, _
                            ByVal page As Page, _
                            ByVal closeCrrPage As Boolean, _
                            Optional ByVal pageWidth As Int32 = 1020, _
                            Optional ByVal pageHeight As Int32 = 660, _
                            Optional ByVal pageTop As Int32 = 0, _
                            Optional ByVal pageLeft As Int32 = 0)
            Dim strFullpath As String = String.Empty              ''全路经
            Dim strPath As String = String.Empty                  ''子路径
            Dim strOpen As New StringBuilder                      ''存储:打开新页字符串
            Dim strClose As String                                ''关闭当前窗口字符串,与strOpen连用        '' http://www.test.com/testweb/default.aspx 
            strFullpath = page.Request.Url.AbsoluteUri
            '' /testweb/default.aspx 
            strPath = page.Request.Path
            ''http://www.test.com
            strFullpath = strFullpath.Remove(strFullpath.Length - strPath.Length, strPath.Length)
            '' 获取文件目录
            pageName = strFullpath & page.Request.ApplicationPath & pageName
            ''打开新页
            strClose = "<script>top.opener=null;self.close();</script>"
            strOpen.Append("<script>window.open('")
            strOpen.Append(pageName)
            strOpen.Append("','','channelmode=no,directories=no,location=yes,menubar=no,resizable=no,scrollbars=no,status=yes,titlebar=no,fullscreen=no,toolbar=no,width=")
            strOpen.Append(pageWidth)
            strOpen.Append("px,height=")
            strOpen.Append(pageHeight)
            strOpen.Append("px,top=")
            strOpen.Append(pageTop)
            strOpen.Append("px,left=")
            strOpen.Append(pageLeft)
            strOpen.Append("px');</script>")
            ''窗口模式判断
            If closeCrrPage Then
                page.Response.Write(strOpen.ToString)
                page.Response.Write(strClose)
            Else
                page.Response.Write(strOpen.ToString)
            End If    End Sub
    END CLASS''回传具体方他不提供,给2建议
    1。回发用_dopostback方法,脚本编写
    2。用session之类媒介存储。
    以下是广告:
    承接web开发,asp.net,php类。
    俄,广告见谅。
      

  9.   

     var NumberFormLinkman=window.showModalDialog("SelectLinkman.aspx","window","dialogheight:500px;dialogwidth:622px;center:yes;status:no;resizable:no;");
       if(NumberFormLinkman!=null&&NumberFormLinkman!="undefined")
       {
         document.getElementById("TPhoneNum").value=NumberFormLinkman;
       }
      

  10.   

    直接用DIV,不要用WEB窗体,效果没DIV好,具体什么实现现在也没有例子,懒得写了
      

  11.   

    用div+iframe也可以,效果也不错