Click here to Skip to main content
15,898,772 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: problem in clearing the sessions Pin
Amit Spadez26-May-10 18:51
professionalAmit Spadez26-May-10 18:51 
GeneralRe: problem in clearing the sessions Pin
Ryan McBeth27-May-10 1:16
Ryan McBeth27-May-10 1:16 
GeneralRe: problem in clearing the sessions Pin
Amit Spadez27-May-10 2:10
professionalAmit Spadez27-May-10 2:10 
GeneralRe: problem in clearing the sessions Pin
Ryan McBeth27-May-10 3:27
Ryan McBeth27-May-10 3:27 
GeneralRe: problem in clearing the sessions Pin
Ryan McBeth27-May-10 3:41
Ryan McBeth27-May-10 3:41 
GeneralRe: problem in clearing the sessions Pin
Amit Spadez27-May-10 18:24
professionalAmit Spadez27-May-10 18:24 
GeneralRe: problem in clearing the sessions Pin
Amit Spadez27-May-10 18:41
professionalAmit Spadez27-May-10 18:41 
GeneralRe: problem in clearing the sessions Pin
Ryan McBeth28-May-10 3:35
Ryan McBeth28-May-10 3:35 
Okay,

Maybe I'm not understanding the whole scope of the problem. If you set a session on the test page and check for that session in the page_load and force a redirect if the test has been submitted, any subsequent return to that page should force the user back to the "thankyou.aspx" page. This is especially frustrating because I work for a company that writes online personality tests. So here's what I do in a nutshell with very, very simplified business logic:

notification.aspx -> answerSheet.aspx -> thankyou.aspx

What I really do is keep it all on the same page and use AJAX and custom controls, but that doesn't help you with your problem.

So here is the rundown (forgive me if there are syntax mistakes here, I'm doing this quick before a meeting):

notification.aspx - This page explains the test, sets up some user info and sets the following in page_load.

protected void Page_Load(object sender, System.EventArgs e)
{
 Session[COMPLETE] = false;

 //The rest of the page loading code down here

}


answerSheet.aspx - This page has the radio buttons for answers. It's here that I would have the following code inside the Page_Load() method in the answersheet.aspx codebehind file:

protected void Page_Load(object sender, System.EventArgs e)
{

   if (Session[COMPLETE] == null)
   {
        //Then we are in a state that we shouldn't be in, push back to the notification page.
        Response.Redirect("notification.aspx");
   }

   if (Session[COMPLETE] == true)
   {
        //Then the user has already taken the test, push forward to "thank_you"
        Response.Redirect("answerSheet.aspx");
   }

  ///The rest of the page code down here

}


thankyou.aspx - This page would have the following code:

protected void Page_Load(object sender, System.EventArgs e)
 {

   Session[COMPLETE] == true;

   //The rest of the page loading code down here

 }


The following code will allow the user to go back to the answer sheet, but it won't matter because on page load, they will be redirected back to the thank you page.

I will not give up on you, brother. If this doesn't help, post the code in the page_load methods and we can go from there.

Ryan McBeth
GeneralRe: problem in clearing the sessions Pin
Amit Spadez28-May-10 3:52
professionalAmit Spadez28-May-10 3:52 
QuestionMessage Removed Pin
24-May-10 22:32
Dot-Net-Dev24-May-10 22:32 
AnswerRe: User Login through http post Pin
saini arun24-May-10 23:32
saini arun24-May-10 23:32 
GeneralRe: User Login through http post Pin
R. Giskard Reventlov24-May-10 23:52
R. Giskard Reventlov24-May-10 23:52 
QuestionMAC address code issue [modified] Pin
Abdul-Rhman Alsri24-May-10 21:41
Abdul-Rhman Alsri24-May-10 21:41 
AnswerRe: MAC address code issue Pin
Peace ON24-May-10 21:53
Peace ON24-May-10 21:53 
GeneralRe: MAC address code issue Pin
Abdul-Rhman Alsri25-May-10 4:36
Abdul-Rhman Alsri25-May-10 4:36 
QuestionIIS as web server Pin
NetQuestions24-May-10 21:35
NetQuestions24-May-10 21:35 
AnswerRe: IIS as web server Pin
Peace ON24-May-10 21:46
Peace ON24-May-10 21:46 
QuestionImport contacts from Gmail and Yahoo in Asp.net Pin
NetMan201224-May-10 21:31
NetMan201224-May-10 21:31 
AnswerRe: Import contacts from Gmail and Yahoo in Asp.net Pin
Peace ON24-May-10 21:36
Peace ON24-May-10 21:36 
QuestionInvalid postback or callback argument error Pin
sudheesh kumar s24-May-10 20:47
sudheesh kumar s24-May-10 20:47 
QuestionEditable gridview in ASP.NET MVC 2.0 Pin
M. K. BASHER24-May-10 19:34
M. K. BASHER24-May-10 19:34 
AnswerRe: Editable gridview in ASP.NET MVC 2.0 Pin
Peace ON24-May-10 20:03
Peace ON24-May-10 20:03 
GeneralRe: Editable gridview in ASP.NET MVC 2.0 Pin
M. K. BASHER24-May-10 23:47
M. K. BASHER24-May-10 23:47 
Questionselecting data from excel sheet Pin
swtlibra24-May-10 19:10
swtlibra24-May-10 19:10 
AnswerRe: selecting data from excel sheet Pin
Gaurav Dudeja India24-May-10 19:12
Gaurav Dudeja India24-May-10 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.