Solved

Back button is not working properly

Posted on 2013-06-03
3
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…

688 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