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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Feb 1, 2012, 8:14 AM
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
Ajitender VijayPosted Feb 1, 2012, 8:13 AM
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);
Aamir KhanPosted Feb 1, 2012, 7:37 AM
Ajitender VijayPosted Feb 1, 2012, 6:13 AM
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 KhanPosted Feb 1, 2012, 5:50 AM