I have this url in my login page:
http://localhost:5550/login?ReturnUrl=/forum/456
I have this controller:
[HttpPost]
public ActionResult Try(LoginModel model){
//How can I read the ReturnURL query string parameter and other params inside my controller?
//what is the recommended way to do this?
}
Thanks
Have you tried
HttpContext.Request.UrlReferrer.AbsoluteUri?That should give your your host’s URL.
EDIT: Seems you changed your post’s question!
I’m not sure this is what you want but to get the ReturnUrl part in your controller, you can pass the string ReturnUrl to your controller for example:
You’ll get the “/forum/456” as a string.