Re: How do I get a page to maintain control states?

From: Patrice (nobody_at_nowhere.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 20:27:11 +0100

I don't see what difference you make between point 1 to 4 and the later
scenario (not clear if you used submit before using the back button).

IMO :
- if something is wrong I would redisplay the whole form with the error
message so that the user doesn't even have to use the back button. Keep in
mind that you would rely here on a client side behavior that the user could
have altered (by changing its IE settings).

- for now I have the behavior you described in point 1 to 4. Could it be a
problem with your cache ? I would try to add a date/time information to the
page to see if the page with blank fields comes from the IE cache or if IE
gets it once again from the server. It could be also a IE settings. For now
it looks liike that when you using the back button, IE gets the page again
(AFAIK it was also the behavior on old IE releases, whcih version are you
using).

Good luck.

Patrice

-- 
"Tom wilson" <yeahright@nospam.com> a écrit dans le message de
news:pv4711hdqr8d679vu10t1qg4d14h13nqvp@4ax.com...
> This is the same topic as the thread above, "Dealing with the Back
> button".  I'm getting nowhere.  The closest I've come is a sample left
> for me:
>
> <%@ Page Language="vb" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> </head>
> <body>
>     <form runat="server" ID="Form1">
>         <p>
>             &nbsp;<asp:TextBox id="TextBox1"
> runat="server"></asp:TextBox>
>         </p>
>         <p>
>             &nbsp;<asp:Button id="Button1" runat="server"
> Text="Button"></asp:Button>
>         </p>
>     </form>
> </body>
> </html>
>
> 1 - Load the page, enter something in the text box.
> 2 - Hit submit
> 3 - Click Back
> 4 - The string you entered remains.
>
> When I put this code, in its entirety, into a new .aspx page and run
> it, the textbox is blank after hitting the back button.
>
> Why, and how can I prevent it?  (before I go completely insane)
>
> Thanks!
>