There are different technique to transfer data from one page to another. The
simple and easy way is to use Session Variable. You can also use QueryString.
For Session variable, You can save the values to a session and redirect the
destination page and then read the date from the session.
let there are two pages WebForm1.aspx and WebForm2.aspx. on the WebForm1 you
have 2 string variables and u want to access these two variables on 2nd page
U have to do on the Webform1.aspx:
string name = "Irfan";
string age = 30;
Session["anySessionVariableName1"] = name;
Session["anySessionVariableName2"] = age;
Response.Redirect("WebForm2.aspx");
on the WebForm2.aspx, u have to do for retrieving the name and age:
string nm = Session["anySessionVariableName1"].ToString();
string ag = Session["anySessionVariableName2"].ToString();
"melinda" wrote:
Ok, sorry if this is dumb ?, but I'm extremely new to ASP.net. I've used
PHP and am now trying to figure out the best way (or any way) to do this in
ASP.net:
I have a page where the user enters data and clicks a submit button which
redirects to another page. This 2nd page can retrieve all of the POST
variables submitted from the previous page. How is this done in ASP.net?
Thanks!