14

I have following Url:

customer/login?ReturnUrl=home

How can I get this string in my view? I tried

RouteData.GetRequiredString("action")

But it does not return full string. Any help will be appreciated.

1 Answer 1

28

Use the HttpRequest.Url.PathAndQuery Property to retrieve the absolute path and query like so:

<%= Request.Url.PathAndQuery %>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.