Back button function using ASP.net MVC

I have a requirement that requires me to redirect the user to the previous page in the browsing history. I am using ASP.net MVC 1.0. I do NOT want to use javascript for this. Any pointers?

+4
source share
3 answers

You can use the Request.UrlReferrer property to render the link. Maybe like this:

 <a href="<%= Request.UrlReferrer %>">Back</a> 
+5
source

In your action, you can take the "returnUrl" parameter and then return RedirectResult. He has to do.

For information, refer to the account controller from the default ASP.NET MVC project on VS2008.

0
source

What about:

 <a class="ImageBtn" href="previous.html" onClick="history.back();return false;">Go back</a> 

In this case, you can assign an image to make it look better.

0
source

All Articles