Hi Frnds,
i want to pass multiple values through a single querystring.
please give me example of its working with syntax.
Thanks & Regards,
Aamir
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Aamir KhanRank #7,345 · 243 reputationPosted Feb 1, 2012, 12:50 AM EST
Ajitender VijayRank #6,843 · 255 reputationPosted Feb 1, 2012, 1:13 AM EST
Use QueryString to send value from one form to another form
send querystring
Response.Redirect("~/GetQueryString.aspx?q1=abc&q2=xyz&q3=fsx");
Get QuertString
String queryString1=Request.QueryString["q1"].ToString();
String queryString2 = Request.QueryString["q2"].ToString();
String queryString3 = Request.QueryString["q3"].ToString();
here you will get the value of queryString and save it in your db
Thanks
-----------------------------
If this post helps you, then mark as "Correct Answer" Thank You
Aamir KhanRank #7,345 · 243 reputationPosted Feb 1, 2012, 2:37 AM EST
Ajitender VijayRank #6,843 · 255 reputationPosted Feb 1, 2012, 3:13 AM EST
textbox means..
you want to send textbox value in querystring ????
if yes then use this code
Response.Redirect("~/GetQueryString.aspx?q1="+TextBox1.Text+"&q2="+TextBox2.Text+"&q3="+TextBox3.Text);
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 1, 2012, 3:14 AM EST
Page1
protected void Button1_Click(object sender, EventArgs e)
{
string strName = "VINZ";
string strAddress = "CEBU";
string strDate = DateTime.Now.ToShortDateString();
Response.Redirect(string.Format("TestNasad2.aspx?param1={0}¶m2={1}¶m3={2}",strName,strAddress,strDate));
}
The on Page2 you can get each values this way below
protected void Page_Load(object sender, EventArgs e)
{
if ((Request.QueryString["param1"] != null && Request.QueryString["param2"] != null) && Request.QueryString["param3"] != null)
{
string name = Request.QueryString["param1"];
string address = Request.QueryString["param2"];
string date = Request.QueryString["param3"];
}
}
Refer
http://geekswithblogs.net/dotNETvinz/archive/2008/09/12/passing-multiple-querystring-values-with-response.redirect-method.aspx
Thanks