2 Replies - 3743 Views - Last Post: 10 June 2011 - 10:54 PM Rate Topic: -----

#1 yunusabd  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 104
  • Joined: 25-October 08

Losing session state

Posted 05 June 2011 - 01:49 PM

I have an application that has about 30 panels and on each one are several questions. After the user clicks next or previous the current panel is hidden and then the next one is display. My problem is that it seems that my webform is loosing its state. For instance I placed in a few labels in different panels to check to see if the value of name was still stored in session, it seems to stay in for a few panel transitions but at the end when there is a panel that displays the contents of all the session variables for verification they are all empty! This is a real big issue because my web form holds over 30 variables all of string type in session state.

for example
//This is at the head of my "Main class" in the code behind 
 Customer customer = new Customer();

 //Bellow is also in the code behind and is executed when the event handler is called.
 //is on one of the panels and happens when an event if fired off e.g the user clicks next
 Session["customer.FirstName"] = (string)(TextBox2.Text);

 //Just a test that is later in the code to see if it stays in session 
 lblTest0.Text = (string)(Session["customer.FirstName"]);
 




I already have everything completely done for the most part. e.g. all the panels, buttons, text fields, radiobuttonlists, ect... And I already have all the code behind done, my problem is as stated above there is something wrong with the session variables.

p.s. At first when I started my project I was using session variables of conditions eg
 if((string)(Session[customer.Name]) == "Bob"])
{
  //hide panels and store data from previous panel
  // display next panel.
}



But then things started to "break" so I changed all conditions to be based on it a radiobutton.index == 0 ect...

That is no longer the issue anymore but If anyone has any insight as to why my session variables won't function for that as well I would appreciate the help.

This post has been edited by yunusabd: 05 June 2011 - 01:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Losing session state

#2 yunusabd  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 104
  • Joined: 25-October 08

Re: Losing session state

Posted 10 June 2011 - 11:51 AM

View Postyunusabd, on 05 June 2011 - 02:49 PM, said:

I have an application that has about 30 panels and on each one are several questions. After the user clicks next or previous the current panel is hidden and then the next one is display. My problem is that it seems that my webform is loosing its state. For instance I placed in a few labels in different panels to check to see if the value of name was still stored in session, it seems to stay in for a few panel transitions but at the end when there is a panel that displays the contents of all the session variables for verification they are all empty! This is a real big issue because my web form holds over 30 variables all of string type in session state.

for example
//This is at the head of my "Main class" in the code behind 
 Customer customer = new Customer();

 //Bellow is also in the code behind and is executed when the event handler is called.
 //is on one of the panels and happens when an event if fired off e.g the user clicks next
 Session["customer.FirstName"] = (string)(TextBox2.Text);

 //Just a test that is later in the code to see if it stays in session 
 lblTest0.Text = (string)(Session["customer.FirstName"]);
 




I already have everything completely done for the most part. e.g. all the panels, buttons, text fields, radiobuttonlists, ect... And I already have all the code behind done, my problem is as stated above there is something wrong with the session variables.

p.s. At first when I started my project I was using session variables of conditions eg
 if((string)(Session[customer.Name]) == "Bob"])
{
  //hide panels and store data from previous panel
  // display next panel.
}



But then things started to "break" so I changed all conditions to be based on it a radiobutton.index == 0 ect...

That is no longer the issue anymore but If anyone has any insight as to why my session variables won't function for that as well I would appreciate the help.


I still have not figured out the issue, does anyone know what may be causing my webform to loose session state?
Is my question too vague if so is there anything that I can add? i.e code, explanation?
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 446
  • View blog
  • Posts: 1,501
  • Joined: 28-April 09

Re: Losing session state

Posted 10 June 2011 - 10:54 PM

How long does it take to get through all the questions? Are all the session variables empty or just some of them? Have you stepped through the code to see if you can find where they first start losing their values?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1