ASP.NET2.0向其它网页传递信息的方法(3)_.Net教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

推荐:迁移你的Web页面到ASP.NET AJAX 1.0
如果你在Web站点中使用了AtlasControlToolkit,那么这篇文章有助于迁移你的Web页面到ASP.NETAJAX1.0,翻译自ASP.NETAJAXControlToolkit网站。 随着ASP.NETAJAX1.0Beta版的发布,带来了很多根本

[NextPage]

  < %@ Page language="vb" %>

  < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

  < html>< head>

  < title>Cross Postback Example 2< /title>

  < /head>< body>

  < script language="vb" runat="server">

  Sub Page_Load()

  If Not (Page.PreviousPage Is Nothing) Then

  If Not (Page.IsCrossPagePostBack) ThenResponse.Write("Name:" CType(PreviousPage.FindControl("txtName"), TextBox).Text "< BR>")Response.Write("E-mail:" CType(PreviousPage.FindControl("txtE-mailAddress"), TextBox).Text "< BR>")

  End If

  End If

  End Sub

  < /script>< /body>< /html>

  

[NextPage]

  < %@ Page language="vb" %>

  < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

  < html>< head>

  < title>Cross Postback Example< /title>

  < script language="vb" runat="server">

  Public ReadOnly Property Name

  Get

  Return Me.txtName.Text

  End Get

  End Property

  Public ReadOnly Property E-mailAddress

  Get

  Return Me.txtE-mailAddress.Text

  End Get

  End Property

  < /script>< /head>< body>

  < form id="frmCrossPostback1" method="post" runat="server">

  < asp:Label ID="lblName" runat="server" Text="Name:">< /asp:Label>

  < asp:TextBox ID="txtName" runat="server">< /asp:TextBox>< br />

  < asp:Label ID="lblE-mailAddress" runat="server" Text="E-mail:">< /asp:Label>

  < asp:TextBox ID="txtE-mailAddress" runat="server">< /asp:TextBox>< br />

  < asp:Button ID="btnSubmit" runat="server" Text="Submit" PostBackUrl="CrossPostback2.aspx" />

  < /form>< /body>< /html>

分享:用事实说话!AJAX应用程序开发七宗罪
AJAX bandwagon是个好去处。它带给你更快、更高效、更强动态的应用。但它也有自身的缺陷。 初一看,具备一些常识似乎就能避免这些缺陷,在一定程度上,的确如此。但从DHTML起源来看,AJAX应用

来源:模板无忧//所属分类:.Net教程/更新时间:2008-08-22
相关.Net教程