Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperlink to go back to previous page in asp .net

Tags:

I have a page in asp .net (http://localhost/error/pagenotfound).

There is a link in page, on clicking on which has to go back to previous page from where I came from.

<a href="#">Go Back to Previous Page.</a>  

How can I go back to previous page by taking from history

like image 422
user1400915 Avatar asked Dec 26 '12 08:12

user1400915


People also ask

How do I go back to the previous page in asp net MVC core?

on click of the link execute javascript history.go(-1) . This will take the browser one step back in the history.

How do I stop asp net from going back to previous page?

Master, I have used the code that to prevent the user from going back to previous pages after logout. function preventBack() { window. history. forward(); } setTimeout("preventBack()", 0); window.


1 Answers

you can use this:

<a href='javascript:history.go(-1)'>Go Back to Previous Page</a> 
like image 137
kleinohad Avatar answered Sep 20 '22 01:09

kleinohad