There are many ways you can do it but since you have large number of textboxes you can set the values in an array and assign the array to a session.
Also please have a look at the other ways you can do it :
----------------------------------------------------------------------------
Using Session State or Application Variable :
Using this technique I will store the data in session variable on the client machine and on the next page will grab it. Using Application Variable instead of Session Variable is recommend by experts.
ASPX Page:
<asp:textbox id="txtData" runat="server" xmlns:asp="#unknown">
<asp:button id="btnSessionState" runat="server" text="Session State" onclick="btnSessionState_Click" xmlns:asp="#unknown">
Code-Behind:
protected void btnSessionState_Click(object sender, EventArgs e)
{
Session["Data"] = txtData.Text;
Response.Redirect("SessionState.aspx");
}
Receiver ASPX Page:
Session State
Data is: <%=Session["Data"] %>
And you all set, run it test it.
Using Query String
Using this technique I will add my data with URL and on the next page will grab it.
ASPX Page:
<asp:textbox id="txtData" runat="server" xmlns:asp="#unknown">
<asp:button id="btnQueryString" runat="server" text="Query String" onclick="btnQueryString_Click" xmlns:asp="#unknown">
Code-Behind:
protected void btnQueryString_Click(object sender, EventArgs e)
{
Response.Redirect("QueryString.aspx?Data=" + Server.UrlEncode(txtData.Text));
}
Receiver ASPX Page:
Query String
Data is: <%=Server.UrlDecode(Request.QueryString["Data"]) %>
And you all set, run it test it.
Using HttpPost
Using this technique I will call a post back url and the on next page using Request.From I will grab it.
ASPX Page:
<asp:textbox id="txtData" runat="server" xmlns:asp="#unknown">
<asp:button id="btnHttpPost" runat="server" text="HTTPPost" postbackurl="~/HttpPost.aspx" xmlns:asp="#unknown">
Note: There is no any code-behind method call instead of a postbackurl in button attribute.
Receiver ASPX Page:
HttpPost
Data is: <%=Request.Form["txtData"] %>
And you all set, run it test it.
Using Public Properties
Using this technique I will send the using a public method and on the next page will grab it using PreviousPage.MethodName.
ASPX Page:
<asp:textbox id="txtData" runat="server" xmlns:asp="#unknown">
<asp:button id="btnPublicProperties" runat="server" text="Public Properties" onclick="btnPublicProperties_Click" xmlns:asp="#unknown">
Code-Behind:
protected void btnPublicProperties_Click(object sender, EventArgs e)
{
Server.Transfer("PublicProperties.aspx");
}
public string PublicData
{
get
{
return txtData.Text;
}
}
Receiver ASPX Page:
Public Properties
Data is: <%=PreviousPage.PublicData %> :