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

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
MyScale Blog
MyScale Blog
Jina AI
Jina AI
B
Blog
Microsoft Security Blog
Microsoft Security Blog
T
Troy Hunt's Blog
博客园_首页
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
GbyAI
GbyAI
T
Tenable Blog
B
Blog RSS Feed
S
Securelist
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
罗磊的独立博客
AWS News Blog
AWS News Blog
V
V2EX
宝玉的分享
宝玉的分享
J
Java Code Geeks
小众软件
小众软件
Spread Privacy
Spread Privacy
腾讯CDC
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
V
Visual Studio Blog
The Hacker News
The Hacker News
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
C
Check Point Blog
Webroot Blog
Webroot Blog
D
DataBreaches.Net
Cloudbric
Cloudbric
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家

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

好久没发言了,随便写一个吧 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代码