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
on click of the link execute javascript history.go(-1) . This will take the browser one step back in the history.
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.
you can use this:
<a href='javascript:history.go(-1)'>Go Back to Previous Page</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With