Form A markup:
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormA.aspx.cs"
Inherits="FormA" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Form A</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
<asp:TextBox ID="TextBox1A" runat="server" />
<cc1:NumericUpDownExtender ID="TextBox1_NumericUpDownExtender"
runat="server" Enabled="True" Maximum="1.7976931348623157E+308"
Minimum="0" TargetControlID="TextBox1A" Width="100">
</cc1:NumericUpDownExtender>
</div>
</form>
</body>
</html>
Form A code-behind:
Code:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class FormA : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (PreviousPage != null)
{
TextBox1A.Text = ((TextBox) PreviousPage.FindControl("TextBox1B")).Text;
}
}
}
Form B markup:
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FormB.aspx.cs"
Inherits="FormB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Form B</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
Put an integer in the textbox below, and click the button to
cross-post it to Form A.
</p>
<asp:TextBox ID="TextBox1B" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Post" PostBackUrl="FormA.aspx" />
</div>
</form>
</body>
</html>