惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯

推荐订阅源

J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
V2EX
小众软件
小众软件
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
The Cloudflare Blog
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
T
Threatpost
T
Tenable Blog
aimingoo的专栏
aimingoo的专栏
IT之家
IT之家
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
U
Unit 42
Spread Privacy
Spread Privacy
博客园 - 司徒正美
Hacker News: Ask HN
Hacker News: Ask HN
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
SecWiki News
SecWiki News
云风的 BLOG
云风的 BLOG
The Register - Security
The Register - Security
AWS News Blog
AWS News Blog
月光博客
月光博客
Security Latest
Security Latest
H
Heimdal Security Blog
S
Secure Thoughts
博客园 - 聂微东
PCI Perspectives
PCI Perspectives
博客园 - 叶小钗
Scott Helme
Scott Helme
O
OpenAI News
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
NISL@THU
NISL@THU
S
Securelist
Latest news
Latest news
P
Proofpoint News Feed
博客园 - 【当耐特】

博客园 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!)

好久没发言了,随便写一个吧 showModalDialog子窗口怎样向父窗口传参数 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!) - 博客园 javascrpt 退出灰色 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!) - 博客园 怎样使一个层垂直居中于浏览器中 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!) - 博客园 梅花雨日历Demo(VS2005) 在配置使用Membership或其他的Providers的ASP.NET2.0时一定要设置applicationName属性 怎么在ASP.NET 2.0中使用Membership ASP.NET结合存储过程写的通用搜索分页程序 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!) - 博客园 存储过程分页 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!) - 博客园 PetShop 4架构分析 PetShop4.0 工厂模式及Profile Provider实现 17种正则表达式 利用Visual C#实现任务栏通知窗口 C#中父窗口和子窗口之间实现控件互操作 ASP.NET动态生成HTML页面 转换字符串中汉字为其拼音缩写(C#) 在C#中设置打印机纸张大小,如此简单 最好用的在线编辑器CuteEditor 好几天没有些东西了
ASP.NET WEB FORM 子父窗体之间参数的传递 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!)
怎能笑的私藏(藏什么呀? · 2007-04-11 · via 博客园 - 怎能笑的私藏(藏什么呀?还没有想好,乱堆!)

两个PAGE的代码如下:
page.aspx(父窗体)

<html>
<body>
<script language="C#" runat="server">
</script>
<form id="Form1" method=post runat="server">
<asp:TextBox ID=txtName Runat=server></asp:TextBox>
<input type=button value="弹出子窗口" onclick="Mywin=window.open('subpage.aspx');">
</form>
</body>
</html>

subpage.aspx(子窗体)

<html>
<body>
<script language="JavaScript">
function popup()
{
window.opener.document.all[
"txtName"].value=document.all["txtSubName"].value;
window.close() 
}
</script>
<script language="C#" runat="server">
</script>
<form id="Form1" method=post runat="server">
<asp:TextBox ID=txtSubName Runat=server></asp:TextBox>
<p><input type="button" value="传值并返回父窗口" name="button1" onclick="popup()"></p>
</form>
</body>
</html>

几点说明:
1。弹出子窗体,将子窗体的textbox的值传递给父窗体
2。两个button都采用html控件,也可以换成asp.net 的server控件,至于server控件如何调用jscript,这里有个小窍门,button_click事件里执行这样的代码

string script="<script language="JavaScript">window.open('subpage.aspx');</script>"
Response.Write(script);

这样就执行了javascript代码