Solved

Back button is not working properly

Posted on 2013-06-03
3
297 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now