.net 2.0 Cross-Page Postback的使用
来源:互联网 发布:真实的网络写手收入 编辑:程序博客网 时间:2024/04/29 13:51
大家还记得吧,在ASP中,一个页面里,只要有一个Form表单,在POST后,就可以在
另外一个表单里用REQUEST来接受了,而在ASP.NET 2.0中,咱们又可以这样做了,因为有了
新的特性,叫做cross page request,可以实现这样的功能,代码如下,十分简单:
crosspage1.aspx:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox>
<asp:Button ID="Button1" Runat="server" Text="Button" PostBackUrl="crosspage2.aspx" />
</div>
</form>
</body>
</html>
crosspage2.aspx:
public void Page_Load()
{
if (PreviousPage != null && PreviousPage.IsCrossPagePostBack)
{
TextBox textBox1 = PreviousPage.FindControl("TextBox1") as TextBox;
if (textBox1 != null)
Response.Write(textBox1.Text);
}
}
- .net 2.0 Cross-Page Postback的使用
- Cross page postback
- Cross-Page Postback 拾遗
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- asp.net 2.0中的Cross PAGE REQUEST
- cross-page posting in ASP.NET 2.0
- Cross page posting in ASP.NET 2.0
- asp.net 2.0中的Cross PAGE REQUEST
- asp.net 2.0中的Cross PAGE REQUEST
- Page对象的PostBack属性
- ASP.NET 2.0 - Validation Groups and Cross-Page Posting
- Asp.Net的PostBack
- 错误日志——PreviousPage is null when attempting a cross-page postback using a button and the PostBack
- asp.net 使用urlrewrite之后的form action postback
- C#中常用到的JS
- 乱砍设计模式之零——序
- 文件系统基本操作
- 程序员笑话(3)-短文两个:开发时间,爱情观.
- SVG脚本编程介绍
- .net 2.0 Cross-Page Postback的使用
- vb读取保存txt文件
- 判断CAknQueryDialog是按YES还是NO
- 程序员笑话(4)-中国电信招聘程序员
- 使用Cross-Page Postback(跨页面提交)在页面间传递数据
- 图像分割阈值选取技术综述
- post 与 get的区别
- 一个不错的免费UML工具:JUDE community
- 2008,下载工具向何处去?