Using the Querystring is the another method to pass information between pages in your ASP.NET application. As we know that Querystring is the portion of the URL after a Question Mark(?). The information is always retrieved as a string that can be converted with any type.Here we get the code to pass multiple values at a single time in Querystring.




Passing multiple Values:

protected void btnSubmit_Click(object sender, EventArgs e)
{
string name = txtName.Text;
string Userid = txtUserid.Text;
Response.Redirect("UserProfile.aspx?username= "+name+"&userid="+Userid);
}

Retrieving Values:

string name = Request.QueryString["name"].ToString();
string userid = Request.QueryString["Userid"].ToString();

Author Bio : I am Arun Rana a 21 years old Part time blogger having a tech Blog Speak Journal ,loves to write about latest Gadgets , Smartphones and all stuff related to technology.

Suggested Entry:

Passing Variables between Pages using QueryString in .Net
ASP.NET SessionState- Handling State in ASP.NET, Set Timeout for Session
Cookies with Multiple Values in ASP.NET
ASP.NET Cookies – Creating, Retrieving and Deleting Cookies
Passing Data Between Window Forms in C#.NET

admin (155 Posts)


One Response to ASP.NET – Passing Multiple Values in Querystring

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.