Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a scenario like:after facing few security questions in same page, unlock button will be visible to user to unlock his account.if user enter wrong answer, a popup window displays to user.after successfully answering security questions,before tap on unlock button if I press browser unlock button its showing previous popup window.how to prevent this pop up window even I click on browser back button.I took this code to prevent back button ,its working fine.
<script type="text/javascript">
history.forward();
</script>

thanks in advance.
Posted

I don't understand your question, but you can't stop people going back. If you disabled caching (google "asp.net disable page cache" for code examples) on the page you don't want them going back to you can probably add code to handle the request in a better way on that page.
 
Share this answer
 
Just put this javascript on the html section of aspx page above head section.
This causes every back to return with a forward.

<script type="text/javascript">
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>

Open the webpage in a popup window rather than normal window. So, that you can restrict the popup window from displaying buttons, menus, status and other features.

I've made it on [removed] - it worked.
 
Share this answer
 
v2
Comments
Member 10714689 23-Jul-15 1:28am    
Hi,its not working,still showing pop up window.my web page is content page in master page.I put <script type="text/javascript">
history.forward();
</script>
in content place holder.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900