asp.net弹出无边框窗口 点击A页面的button弹出一个无边框的窗口B,在B中选择复选框后,把值传回A页面中,请给出完整代码,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.px915.com/lhgdialog/_demo.html参考…… 无边框的窗口? 显示一个div, 把其它蒙住. 选择完把div隐藏, 其它显示. 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); } B页面返回值window.returnValue='XXX'; 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); }不行来找我! 在一个窗体中使用JS+DIV也可啊 能具体点吗?最好有完整的代码,本人对JavaScript不是很熟悉,谢谢 ''类库<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 SubEND CLASS''回传具体方他不提供,给2建议1。回发用_dopostback方法,脚本编写2。用session之类媒介存储。以下是广告:承接web开发,asp.net,php类。俄,广告见谅。 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; } 直接用DIV,不要用WEB窗体,效果没DIV好,具体什么实现现在也没有例子,懒得写了 用div+iframe也可以,效果也不错 求助 关于命名空间的问题 在线等 当需要部署多个站点共用一个应用程序时,如何拆分Web.Config文件? CustomValidator验证控件的客户端验证方法应该怎么写? Repeater控件时数据绑定时的一点问题 在线等~表字段的类型问题 困惑~~困惑~~还是困惑~! COME IN PLAESE!!!!!!!!!! 急!急!急!新手问题,DataGrid分页后为什么显示页数数而不显示内容帮我看看!在线等侯! 删除数据问题 关于一个乱码的问题 求大神帮忙,关于post json问题 关于采集的问题。 在线等关于DropDownList控件的问题,如何分别连接两个数据源
if(returnValue!=""&&returnValue!=null){
alert(returnValue);
}
<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);
}不行来找我!
<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类。
俄,广告见谅。
if(NumberFormLinkman!=null&&NumberFormLinkman!="undefined")
{
document.getElementById("TPhoneNum").value=NumberFormLinkman;
}