How to handle browser back button ?

Posted by Sahoo under ASP.NET on 4/29/2013 | Points: 10 | Views : 2527 | Status : [Member] | Replies : 5
Hi
I had a page lets say User.aspx. It shows all users on a grid.On clicking view column a a row , a pop up appear that display user details. Now close the pop up and go to another page directly. Lets say CompanyDetails.aspx. Now on clicking browser back button server appear as page redirect to user details page not user page(User.aspx).How can I directly go to (User.aspx) without opening the pop up.

Many many thanks in advance.




Responses

Posted by: Satyapriyanayak on: 4/29/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
http://www.dotnetfunda.com/articles/article687-handle-back-button-of-the-browser.aspx

If this post helps you mark it as answer
Thanks

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sahoo on: 5/3/2013 [Member] Starter | Points: 25

Up
0
Down
I cannot disable back button .

Can you let me know how to remove top entry from browser history ? Can we prevent a specific url to be entered in browser history ?

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sahoo on: 5/7/2013 [Member] Starter | Points: 25

Up
0
Down
I did it by adding history.back() at end .Previously it was


"window.open('ABC.aspx"', 'TEST', 'width=800, height=700, scrollbars=yes,resizable=yes, status=no, toolbar=no, location=no, top=45, left=45');";

changed it to
"window.open('ABC.aspx"', 'TEST', 'width=800, height=700, scrollbars=yes,resizable=yes, status=no, toolbar=no, location=no, top=45, left=45');history.back();";


Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Valley on: 5/7/2013 [Member] Starter | Points: 25

Up
0
Down
I am sorry I did not understand your question.

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Valley on: 5/7/2013 [Member] Starter | Points: 25

Up
0
Down
This is the script that I used for logout option. Hope it will help you

<script type="text/javascript" language="javascript">
{
window.history.forward(1);
document.attachEvent("onkeydown", my_onkeydown_handler);
function my_onkeydown_handler()
{
switch (event.keyCode)
{
case 116: // F5;
event.returnValue = false;
event.keyCode = 0;
window.status = "We have disabled F5";
break;
}
}
</script>

Sahoo, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response