Hi,
I want a user to be moved from the current page to next page after 5 mins and so on for certain no of pages.. how do i do it...
The user is register and authenticated.. I want the user to view the page only for 5 mins like that i may have 50-100pages...
Like for in online exams how user can view the question for 5 mins and the next question/page appears...Please help..
Loading
CrishPosted Mar 28, 2011, 1:33 AM
Sam HobbsPosted Mar 27, 2011, 7:44 PM
You could compare the time that an answer is received by the server and if it is sufficiently past the time period it is supposed to be then there is reason to suspect cheating, but you can't assume someone is guilty since the problem might be a bad connection.
I think it would work to do this from the server instead of using JavaScript but I don't know ASP well enough to suggest how to do it. You will need to use a timer in the server.
If you want to show a countdown timer then you probably want to use JavaScript for that.
Soft CornerPosted Mar 27, 2011, 6:31 AM
The following javascript is used to redirect the user to another page after 60 seconds.
window.setTimeout('window.location.href=\"WebPage1.aspx\"',60000);
function Timer()
{
window.setTimeout('UpdateLabel()',1000);
}
function UpdateLabel()
{
var label = document.getElementById('<%=Label1.ClientID %>');
label.innerHTML = parseInt(label.innerHTML) - parseInt('1');
window.setTimeout('UpdateLabel()',1000);
}
1. Set timer to 60 seconds which will redirect the user to WebPage1.
2. Call the UpdateLabel Function each second to show the decremental timer to the user
3. Get the label object
4. Decrease the label value by 1
5. Recall this function every 1 seconds.