0

I am new to mvc. I have a returnurl argument in my action method of my controller sent from another controller. The returnurl has querystring parameters which i require to process in my controller action method.

I tried Request.QueryString[] but the url is encoded so unable to fetch the parameters.

Is there a way to fetch the parameters and its values from the returnurl argument?

1
  • You can get by Index. Request.QueryString[0] Commented May 25, 2016 at 11:09

1 Answer 1

0

get your returnurl from querystring which you said was encoded.

Decode it using the built in HttpUtility.

string returnUrlEncoded = Request.QueryString["returnUrl"];
string returnUrlDecoded = HttpUtility.HtmlDecode(returnUrlEncoded);

Then use the advice / example code in extract query string from a URL string

to get your querystring values from your return url.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.