Go Back to the previous page in ASP.NET

Here I am going to show how we can use a button to go back to previous page in asp.net c# without post back.
We can use ASP button or Link Button to:

If you use Hyper Link:

  1. <a href="javascript: history.go(-1)">Go Back</a> 

OR

  1. <a href="##" onClick="history.go(-1); return false;">Go back</a> 

If you want to use ASP.NET Button:

  1. <asp:button id="btnCancel" runat="server" text="Cancel" OnClientClick="JavaScript:window.history.back(1); return false;" /> 
Ebook Download
View all
Learn
View all