| Author: Sujit Kumar 05 Jul 2008 | Member Level: Diamond | Rating: Points: 6 |
you can pass value to next page through session or querystring
1. using session simply put value in session object and retrieve value in next page like: //on first page. Session["name"]=txtname.Text; Session["city"]=txtcity.Text; Session["education"]=txtedu.Text; //on second page you can retrieve value from session like: string name=Session["name"].tostring(); string city=Session["city"].tostring(); string education=Session["education"].tostring();
2. using querystring you can pass value like: //on first page response.redirect("page2.aspx?name="+txtname.text+"&city="+txtcity.text+"&education="+txtedu.text);
//on second page to retrieve value from querystring :
string name=Request.QueryString["name"].tostring(); string city=Request.QueryString["city"].tostring(); string education=Request.QueryString["education"].tostring();
|
| Author: Sri Harsha 05 Jul 2008 | Member Level: Silver | Rating: Points: 6 |
HI,
You can pass the values to next page using QueryString or Sessions.
One approach is store all the values in Sessions ,so that you can retrieve these values in the next page. Session["Name"] = txtName.Text; Session["City"] = txtCity.Text; Session["Education"] = txtEdut.Text;
and in the second page you can get the session values like this string Name=Session["Name"]; string City=Session["City"]; string Edu=Session["Education"];
and the second approach is with Query string You can append all the values with the url to whcih you are redirecting.
Ex : string url = "QueryStringRecipient.aspx?"; url += "Name=" + txtName.Text + "&"; url += "City=" + txtCity.Text + "&"; url += "Edu=" + txtEdut.Text ;
Response.Redirect(url);
|
| Author: tushqi 05 Jul 2008 | Member Level: Silver | Rating: Points: 6 |
You can pass the values to next page using QueryString or Sessions.
One approach is store all the values in Sessions ,so that you can retrieve these values in the next page. Session["Name"] = txtName.Text; Session["City"] = txtCity.Text; Session["Education"] = txtEdut.Text;
and in the second page you can get the session values like this string Name=Session["Name"]; string City=Session["City"]; string Edu=Session["Education"];
and the second approach is with Query string You can append all the values with the url to whcih you are redirecting.
Ex : string url = "QueryStringRecipient.aspx?"; url += "Name=" + txtName.Text + "&"; url += "City=" + txtCity.Text + "&"; url += "Edu=" + txtEdut.Text ;
Response.Redirect(url);
i used it but it is not working u must check it
|