| < html> < head>< title>Sample HTML form< /title>< /head> < body> < form name="frmSample" method="post" action="target_url"> < input type="text" name="fullname" id="fullname" /> < input type="button" name="Submit" value="submit" /> < /form> < /body>< /html> |
| [NextPage] < %@ Page language="vb" %> < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < html>< head> < title>Cross Postback Example< /title> < /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> |
| [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> |
| [NextPage] < %@ Page language="vb" %> < %@ Reference Page="~/CrossPostback1.aspx" %> < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > < html>< head> < title>Cross Postback Example 3< /title> < /head>< body> < script language="vb" runat="server"> Sub Page_Load() Dim cppPage As CrossPostback1_aspx If Not (Page.PreviousPage Is Nothing) Then If Not (Page.IsCrossPagePostBack) Then If (Page.PreviousPage.IsValid) ThencppPage = CType(PreviousPage, CrossPostBack1_aspx)Response.Write("Name:" + cppPage.Name + "< br>")Response.Write("E-mail:" + cppPage.E-mailAddress) End If End If End If End Sub < /script>< /body>< /html> |