IE won't maintain page state

Discussion in 'ASP .Net' started by Tom wilson, Feb 17, 2005.

  1. Tom wilson

    Tom wilson Guest

    Yes, I'm sorry, it's me again. :)

    Yesterday I went through hell trying to figure out why my aspx pages
    wouldn't maintain state. I had a simple example I (we) eventually got
    to work.

    What I've discovered is that my problem seems to lie entirely with IE.
    A bit of history...

    My app is an online survey. The questions, choices and so on are
    stored in SQL Server tables. So my app has a login screen. It
    redirects to survey.aspx. This page reads the questions and
    dynamically creates the required controls; radios, textboxes, etc.
    Like so:

    Radios(x) = New Texbox
    Radios(x).ID = Q.ID
    Radios(x).Text = Q.QText
    etc...

    Each control is appended to a static placeholder. That works.

    When a user clicks submit, the page goes to the server and code within
    the click event checks the submission for errors (like a required
    question not filled out). It stores this data in 2 arrays and the
    code then goes through the question order again, inserting (using
    AddAt) red error texts below the question texts. The page is returned
    to the browser with error messages. That works.

    I can correct, submit, correct, submit etc. and the errors disappear
    one by one until the page is error free. That works.

    Now the problem; the Back button.

    If at any point during the above error/corection process the user
    presses Back, all page data either disappears or I get "Page has
    expired". That's with IE6.

    If I use Netcape or Firefox, I can submit many, many times, and go
    back many, many times. The controls I selected remain selected. If I
    submit 10 times and go back 10 times, it's a perfect history of my
    selections. But if I use IE6, any click of the back button loses all
    data.

    Keep in mind this process is all performed with the same page. I do
    understand a redirect will abandon the form and its control states but
    this isn't the case, fyi.

    I can put IE and Netscape side by side on the same machine. Netscape
    will retain the form values. IE will not.

    Any ideas why?
    Thanks!!!
     
    Tom wilson, Feb 17, 2005
    #1
    1. Advertising

  2. Tom wilson

    Tom wilson Guest

    Nevermind.

    In an effort to circumvent the back button, through the many, many
    attempts to make this work, I left a statement in the Page_Load that
    disables the browser history. I removed that and my pages work 100%.
    No problem.

    WHEW. A HUGE thank you to all that gave any advice.

    Tom


    On Thu, 17 Feb 2005 09:41:07 -0500, Tom wilson <>
    wrote:

    >Yes, I'm sorry, it's me again. :)
    >
    >Yesterday I went through hell trying to figure out why my aspx pages
    >wouldn't maintain state. I had a simple example I (we) eventually got
    >to work.
    >
    >What I've discovered is that my problem seems to lie entirely with IE.
    >A bit of history...
    >
    >My app is an online survey. The questions, choices and so on are
    >stored in SQL Server tables. So my app has a login screen. It
    >redirects to survey.aspx. This page reads the questions and
    >dynamically creates the required controls; radios, textboxes, etc.
    >Like so:
    >
    >Radios(x) = New Texbox
    >Radios(x).ID = Q.ID
    >Radios(x).Text = Q.QText
    >etc...
    >
    >Each control is appended to a static placeholder. That works.
    >
    >When a user clicks submit, the page goes to the server and code within
    >the click event checks the submission for errors (like a required
    >question not filled out). It stores this data in 2 arrays and the
    >code then goes through the question order again, inserting (using
    >AddAt) red error texts below the question texts. The page is returned
    >to the browser with error messages. That works.
    >
    >I can correct, submit, correct, submit etc. and the errors disappear
    >one by one until the page is error free. That works.
    >
    >Now the problem; the Back button.
    >
    >If at any point during the above error/corection process the user
    >presses Back, all page data either disappears or I get "Page has
    >expired". That's with IE6.
    >
    >If I use Netcape or Firefox, I can submit many, many times, and go
    >back many, many times. The controls I selected remain selected. If I
    >submit 10 times and go back 10 times, it's a perfect history of my
    >selections. But if I use IE6, any click of the back button loses all
    >data.
    >
    >Keep in mind this process is all performed with the same page. I do
    >understand a redirect will abandon the form and its control states but
    >this isn't the case, fyi.
    >
    >I can put IE and Netscape side by side on the same machine. Netscape
    >will retain the form values. IE will not.
    >
    >Any ideas why?
    >Thanks!!!
     
    Tom wilson, Feb 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. twahl
    Replies:
    2
    Views:
    638
    Tian Min Huang
    Jun 30, 2003
  2. George
    Replies:
    2
    Views:
    475
    Saravana
    Jul 21, 2003
  3. chak
    Replies:
    1
    Views:
    595
  4. Bruno Ferreira
    Replies:
    0
    Views:
    465
    Bruno Ferreira
    Nov 6, 2003
  5. Tom wilson

    Simple page won't maintain state

    Tom wilson, Feb 14, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    886
    Leo Muller
    Feb 17, 2005
Loading...

Share This Page