•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,960 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1458 | Replies: 6
![]() |
I have an online exam system in which after the test, the result is displayed in a new asp.net page. If he clicks on the 'back' button on the browser, he gets back to the page which displays the test again.
What I want to do is disable the user from going back.(Show some message like 'Page has expired' )
Hope you got what I'm trying to say. Is there any way in which this can be done?
What I want to do is disable the user from going back.(Show some message like 'Page has expired' )
Hope you got what I'm trying to say. Is there any way in which this can be done?
My blog on .NET- http://dotnet.tekyt.info
Well, I googled a bit (I rely more on daniweb than google these days) and what I found was this cannot be done.
However, a work around this is clearing the cache using a javascript. Javascript might be disabled on your browser, but then I guess there is no other way.
Discussion here: http://forums.asp.net/t/989339.aspx
If anybody has a more elegant solution, I'm all ears.
However, a work around this is clearing the cache using a javascript. Javascript might be disabled on your browser, but then I guess there is no other way.
Discussion here: http://forums.asp.net/t/989339.aspx
If anybody has a more elegant solution, I'm all ears.
My blog on .NET- http://dotnet.tekyt.info
•
•
Join Date: Feb 2007
Posts: 18
Reputation:
Rep Power: 2
Solved Threads: 1
Well, why don't you try using pop up windows. I mean, sure you will have to deal with the PopUp blockers, but that's another issue and still have to deal with the javaScript problem. At least you get to choose if you want the scroll bars, the navigation bar, the status bar, the width and lenght etc, etc.
My recomendation is IMHO would be: build a profile of the users that will be using your app. Their probable browsers, their OS, their hardware. Then juggle with what you can provide and what they can receive.
I forgot. Check this out. http://www.htmlgoodies.com/tutorials...le.php/3478911
My recomendation is IMHO would be: build a profile of the users that will be using your app. Their probable browsers, their OS, their hardware. Then juggle with what you can provide and what they can receive.
I forgot. Check this out. http://www.htmlgoodies.com/tutorials...le.php/3478911
Last edited by inzomniac : Jul 7th, 2008 at 11:47 pm.
•
•
Join Date: Jan 2008
Location: Largo Florida
Posts: 276
Reputation:
Rep Power: 1
Solved Threads: 23
instead of disabling the back button, give each test an id and keep the id in a session variable, on each page load event handler of the test page check if the test id matches the one the user has taken, if that is true response.redirect the user to another page or just alert a message indicating that test has been taken by that user. this is the more prevalent way as far as i have seen on the testing sites.
Serkan Şendur
MCAD.NET
MCAD.NET
@Serkan
What about the case in which the test is being taken by a user and then he clicks the back button? How can this situation be handled?
What about the case in which the test is being taken by a user and then he clicks the back button? How can this situation be handled?
My blog on .NET- http://dotnet.tekyt.info
•
•
Join Date: Jan 2008
Location: Largo Florida
Posts: 276
Reputation:
Rep Power: 1
Solved Threads: 23
ok then the best way is to seperate the test and the rest of the content on your pages. cisco forexample does this way. when you start the test it opens a new window with all of the explorer tools disabled including resizing. that way there is not even any back button. in this case if you are going to say what if they right click on the page and select the back from the context menu, i would say you can block the context menu with javascript with one lines of code. you can also easily communicate with the opened window and the opener window. what do you think about my second idea? if you dont like this second one i would add some to the first one. if the user clicks the back button while having the test you can not just do anything, but if you create a start button to start the test then you can set the test id before submitting the test. So, even if they havent yet finished the test, you can control the flow of the user via the start button which is a requirement to start the test. also even if they quit before submitting the test, you can keep the given answers via asyncronous postbacks for each answers selected by the user. so your database will have a field with boolean type indicating whether the test has been submited or quit before submission. then user can be able to continue to the test. i know i talked so much but these are just to give you an opion about what could be done about testing. i think opening a second window will be the easiest.
Serkan Şendur
MCAD.NET
MCAD.NET
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Textboxs not staying disabled after browser back button clicked (JavaScript / DHTML / AJAX)
- Disabling back button in asp.net (JavaScript / DHTML / AJAX)
- How to disable back button and backspace using Javascript..? (JavaScript / DHTML / AJAX)
- How to disable Back button of IE when executing welcome.aspx page? (ASP.NET)
- How can pass backspace(go previous page)fuctionality to a button (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: batch insert in gridview
- Next Thread: passing parameter


Linear Mode