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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 维生素C.NET

[ie8特性1] 6个conection per domain的设计 asp.net 3.5 extensions readme Vista上无法使用WCF的处理方法 SQL Server 2005 Management Studio假死的情况 Internal .Net Framework Data Provider error 6 查找含有特定字符的存储过程 firefox, IE6, IE7在CSS hack上的入口点 不知道多少人存在这个误解: Google Reader/Google Notebook使用以前的英文界面的办法 编译IronRuby项目和修复其中的一些bugs IronRuby博客中文版-- IronRuby: a promising start IronRuby的下载 关于SQL Server的两个细节 为LINQ提速的i4o和增强功能的SLINQ 在Longhorn Server上无法安装SQL Server 2008 (Katmai) 设置Longhorn Server中的图片缩略图显示 关于控件部分的看法--读Programming ASP.NET中文版 分享一本入门级好书:Programming ASP.NET中文版 555,又丢了一辆自行车
http的基础知识帮助减少代码量和复杂度的一个Demo - 维生素C.NET - 博客园
维生素C.NET · 2007-07-19 · via 博客园 - 维生素C.NET

先看完RFC再看!

action属性在asp.net ajax上看来似乎出了点问题

,今天看到了唐兄的这篇文章,加上前天学到的一个知识,拿出来跟大家分享一下:

朋友遇到这样一个场景:需要把页面的某个control的值post到另一个页面来显示。html的post是对整个form做post操作,当这个form中其他元素的value比较大时这个form的post此时就不经济了。如果仅仅想把一个type="text"的input的元素的值传送到另一个页面怎么办?使用querystring方式传值是受url约束的,使用ajax方式那么我们还要动手写一些代码,当然还受sandbox的约束。那么我们来看下面这个Demo:

<form id="form2" action="show.aspx" method="post" target="mywindow">
<input id="txtbox1" name="txt1" type="text" value="维生素C.net 范维肖 fanweixiao" />
<input id="Button1" type="button" value="button" onclick="doSubmit()" />
</form>
<script type="text/javascript">
function doSubmit()
{
    window.open('','mywindow');
    document.forms[
"form2"
].submit();
}

</script> 

我们在Default.aspx中创建了一个form,指定了action到show.aspx页面,target指定了值mywindow。然后我们自己写了这个form的submit事件,首先window.open了一个空页面,并指定了与form的target相同的名字,然后让这个form提交。注意type="text"的input我们添加了name属性,并赋值为txt1。show.aspx页面的代码很简单:

protected void Page_Load(object sender, EventArgs e)
{
        Response.Write(Request[
"txt1"
]);
}
 


这样我们就通过action+target两个属性将我们需要的value直接灌入到了打开的空页面中了。