Solved

Back button is not working properly

Posted on 2013-06-03
3
300 Views
Last Modified: 2013-06-12
I have a web form with back button in .NET 3.5 web application created using VS2010  .
I am using  this line in the page load event.
btnBack.Attributes.Add("onClick", "javascript:history.back(); return false;");
The web form has GridView with command button for editing the GridView rows.It has Update and Cancel buttons.

After clicking the command button(it will show  Update and cancel buttons) ,If I click the back button it is still staying in the same page.(It is showing the Update,Cancel view of the
page. It is not going to previous page.
Without clicking the Command Button if I click the back button it is going to previous page.

How to make it work.

Thanks.
0
Comment
Question by:KavyaVS
  • 2
3 Comments
 
LVL 18

Accepted Solution

by:
Rajar Ahmed earned 500 total points
ID: 39217875
history.back();
This works based on page referrer when u cause postback  then referrer will be updated to the current page and hence u stay on the same page .

Try this solution ,
http://www.devx.com/vb2themax/Tip/18842

Meeran03
0
 

Author Comment

by:KavyaVS
ID: 39242700
It is working.
Thanks
0
 

Author Closing Comment

by:KavyaVS
ID: 39242703
Thanks
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question