Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My question is how to disable back button of browser so that student who can sit for exam dont able to go back through browser back button.My All pages are Master page.
Posted

You should probably give you pages a unique identifier and when the user clicks on 'Submit' or 'Next page' (whatever you have done) record in a database the user has completed that page.

user_name    page_id    is_completed
dmorley      1          1 
dmorley      2          0
dmorley      3          0


As part of each page load, have the page check the database for the user and see if 'is_completed' is true. If so, have the page redirect to the next page or a holding page showing 'Sorry, you have already completed this section and must now proceed to the next page'.
 
Share this answer
 
There are plenty of examples showing how to do this. Did you bothered searching? Although none of them IMO is perfect.
 
Share this answer
 
Disabling the browser button is not possible.

All you can do is try to handle the situation when the user uses the button. As mentioned by d@nish, there are a lot of exampels of that around if you Google for them.

I also agree with d@nish that none of them are perfect.

OT: Hey d@nish - your nick should actually be mine. I AM from Denmark... :)
 
Share this answer
 
v2
Comments
dan!sh 4-Jun-10 9:51am    
Hehe...I face this more often than not on CP. See this* thread of mine.

*http://www.codeproject.com/Lounge.aspx?msg=3487711#xx3487711xx
** posting links does not seems to work with comments.

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