For a user signup process, I have two pages containing forms.
The process is as follows:
User enters data in page 1, the Server.Transfer("page2.aspx", true) to page 2.
On page 2, I can see all the form variables form page one by doing a foreach (string vars in Page.Request.Form) ...
That's fine, but then when I hit the submit button and read the postback data (in Button1_Click(object sender, System.EventArgs e)) to enter to the db, using the same foreach method, all I see are the fields from page 2, and nothing from page 1.
I've tried faking it out by adding this to the form in page 2:
Even w/o the !IsPostBack it doesn't work.
Can someone assist me with how to do this please?
Thank you.
The process is as follows:
User enters data in page 1, the Server.Transfer("page2.aspx", true) to page 2.
On page 2, I can see all the form variables form page one by doing a foreach (string vars in Page.Request.Form) ...
That's fine, but then when I hit the submit button and read the postback data (in Button1_Click(object sender, System.EventArgs e)) to enter to the db, using the same foreach method, all I see are the fields from page 2, and nothing from page 1.
I've tried faking it out by adding this to the form in page 2:
Code:
if (!IsPostBack)
{
// add fields from previous page
foreach (string fields in Page.Request.Form)
{
//if (fields.StartsWith("Txt"))
//{
Response.Write("Adding: " + fields + ": " + Request.Form[fields] + "<br>");
//Response.Write ("<input type='hidden' name='" + fields + "' value='" + Request.Form[fields] + "'>");
Response.Write ("<asp:TextBox id='" + fields + "' runat='server' Visible='true'>" + Request.Form[fields] + "</asp:TextBox>");
}
}
}
Even w/o the !IsPostBack it doesn't work.
Can someone assist me with how to do this please?
Thank you.