Click here to Skip to main content
15,850,545 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,


I am working on an examination portal.

The Test page is having Next and Previous buttons. If previous button is clicked, we need to check whether the question is answered or not. If answered, Page expired message should display. Else go back to previous page.

Please help me on this.

Regards,
Raghu
Posted

1 solution

use the session.
if the user answer the page then,
after successfull submit make the session for that page and
give "some value" in this session.
and if the user is not answered the page then give session value= null
and on page load event
check that session value .if it is null then it has to be ansewered and if it is not then check that value that you give on the submit button of the question.
if it Equall then forward it to that page which you wanted.


on Answer
C#
Submit button()
{
if(answer submitted)
{
session["pagename"] = "answered";
}
else
{
session["pagename"] = null or your value.
}
}



and on
C#
page load event
{
if (session["pagename"]=="answered")
{
response.redirect("your page URL");
}
else
{
//he can answer your page.
}
}


if you have any problem then tell me the feedback.
 
Share this answer
 
v2
Comments
Raghuveer Kasyap 6-Jul-12 6:07am    
I Solved It...

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