Hi,
make it a server control hiddenfield. Set the PostbackUrl property of the button to the next page and retrieve the information there.
For a good example on how to use the PostBackUrl property take a look at http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.postbackurl.aspx.
Page 1:
<%@ page language="C#" %>
<!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 id="head1" runat="server">
<title>Button.PostBackUrl Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Button.PostBackUrl Example</h3>
Enter a value to post:
<asp:textbox id="TextBox1"
runat="Server">
</asp:textbox>
<br /><br />
<asp:button id="Button1"
text="Post back to this page"
runat="Server">
</asp:button>
<br /><br />
<asp:button id="Button2"
text="Post value to another page"
postbackurl="Button.PostBackUrlPage2cs.aspx"
runat="Server">
</asp:button>
</form>
</body>
</html>
Button.PostBackUrlPage2cs.aspx:
<%@ page language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Page_Load (object sender, System.EventArgs e)
{
string text;
text = ((TextBox)PreviousPage.FindControl("TextBox1")).Text;
if (text != "")
PostedLabel.Text = "The string posted from the previous page is "
+ text + ".";
else
PostedLabel.Text = "An empty string was posted from the previous page.";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="head1" runat="server">
<title>Button.PostBackUrl Target Page Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Button.PostBackUrl Target Page Example</h3>
<br />
<asp:label id="PostedLabel"
runat="Server">
</asp:label>
</form>
</body>
</html>