RG-3
RG-3

Reputation: 6188

How to capture the whole query string?

I want to capture all the query string which is coming from the back page into a string and throw as a Response.Redirect("myPage.aspx?ALL Query String Goes Here").

How should I do this? Thanks!

Upvotes: 1

Views: 409

Answers (2)

meiosis
meiosis

Reputation: 26

This works for me:

string redirectURL = "http://www.example.com/myPage.aspx?" + Request.QueryString.ToString(); 
Response.Redirect(redirectURL);

Upvotes: 1

James Hill
James Hill

Reputation: 61802

This will give you the raw querystring.

Request.Url.Query

Upvotes: 5

Related Questions