Geeks With Blogs

News

Microsoft MVP


Moderator at CodeASP.NET


Quiz Master




free counters
Free counters
Added on January 19,2012


Follow Me @vmsdurano

A bit About Me



Disclaimer
The opinions expressed herein are my own personal opinions and does not represent the opinions of my employers. Nor does it represent the opinion of my dog, because I don’t have one.


Vinz' Blog (ProudMonkey) "Code, Beer and Music ~ my way of being a programmer"

Here's an example on how to pass Multiple querystrings in the page..

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}&param2={1}&param3={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"];

        }
}

Hope this Helps!

Technorati Tags: ,,
Posted on Friday, September 12, 2008 1:40 AM ASP.NET , C# , Tips&Tricks | Back to top


Comments on this post: Passing Multiple Querystring values with Response.Redirect method

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Its good
Left by Sujit on Oct 25, 2008 10:45 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Hi,

Thanks for your code.It definatesly help me lot.
Left by Samrat Dutta on Feb 26, 2009 10:05 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Hi,

Thanks for your code.It definately help me lot.
Left by Samrat Dutta on Feb 26, 2009 10:05 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Still having problems!!!! params are capturing the data!!!!
Left by harris on May 09, 2009 11:31 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
thanks !!!
Left by Marvel on Sep 27, 2009 10:16 AM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks Sir, You solved my problem actually problem is related to passing multiple values from one page to another.Lot of Thanks
Left by Rakesh Khambra on Dec 02, 2009 11:13 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks alot you really solved my problem.
Left by amzu on Aug 02, 2010 1:31 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
thanks aload for this code share!!! its excellent!! it reilly works
Left by Sahar on Oct 09, 2010 1:56 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks for you code.......
i have learn new thing from you thanking you once againg
Left by Ram on Oct 13, 2010 1:57 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks . it is a really nice code
Left by Biswajit on Jul 20, 2011 10:00 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thank u:-)
Left by naresh on Feb 17, 2012 9:45 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thank you Its Really nice code and saved my time!!!
Left by starsubash on Feb 20, 2012 6:51 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks.... its working good....
Left by Anushia.M.N on May 08, 2012 4:13 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
thanxxxxxxxx alot............
Left by dinesh on May 09, 2012 6:57 AM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Heartily Thanks its very helpful for me
Left by Hari Sharma on Aug 27, 2012 1:26 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Dear Friends,
Season Greetings!!!

I am facing an issue in adding a second parameter to this querystring. would you please help me in this..

e.Item.Cells[0].Text = "<a title=\"Click to see " + functions.email.getFullName(e.Item.Cells[0].Text) + "'s Pending Requests\" href=\"default.aspx?U=" + e.Item.Cells[0].Text + "\">" + functions.email.getFullName(e.Item.Cells[0].Text) + "";

Thanks in advance.
Left by Naveenkumar on Nov 08, 2012 5:06 AM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
hi, helooo
Left by dfgdf on Jan 26, 2013 1:32 PM

# re: Passing Multiple Querystring values with Response.Redirect method
Requesting Gravatar...
Thanks its very helpful for me................
Left by Akhilesh Khare on Feb 15, 2013 10:31 AM

comments powered by Disqus

Copyright © Vincent Maverick Durano | Powered by: GeeksWithBlogs.net | Join free