We help IT Professionals succeed at work.
Get Started

How to Use Response.Redirect and Pass/Keep All Existing Querystring Parameters In The Redirect

endrec asked
Last Modified: 2013-11-07
I wanted to know if there is a way to redirect the user from one page to another, but keep all the existing querystring parameters in the original page request.

Example:  User is on the URL domain.com/folder/page.aspx?key1=1&key2=yes&key3=456534234-5445435 and some action needs to redirect the user to domain2.com/folder2/page2.aspx but also pass all the existing querystring variables as the number of querystring variables in page.aspx differs occasionally (e.g. not always three querystring variables).  So the final redirect would take the user to domain2.com/folder2/page2.aspx?key1=1&key2=yes&key3=456534234-5445435 in the example.
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE