I have a textbox, txtName, runat=server. When the submit button is clicked, I want to change the value of txtName in the code-behind page and then submit the changed form variable to another page. It seems that the value of txtName must also be changed client-side in order for the value to persist to the next page. Here's a brief of what I have. The changed value of txtName does not carry over to Page2.aspx:
private void btnSubmit_Click(object sender, System.EventArgs e)
{
txtName.Value = "somethingelse";
Server.Transfer("Page2.aspx");
}
private void btnSubmit_Click(object sender, System.EventArgs e)
{
txtName.Value = "somethingelse";
Server.Transfer("Page2.aspx");
}