viewstate question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Will

    #1

    viewstate question

    I have a form on my page. when I submit it and hit the
    back button on my browser all of the information is gone.
    I have enableViewState set to true in my page directive..
    isn't that the point of it? what else do I need to do to
    get my form to maintain it's state?


    I have two methods of submitting that I've tried.. one
    does a response.redire ct, the other hides the UserControl
    with my form on it and shows another UC with my next page
    on it. either way when I hit back the form is empty.

    I am prepared to store the field values in my session and
    have my form pull them back out if they are there (when I
    hit back), but I though this viewstate thing was supposed
    to take care of all that for me.
  • Kevin Spencer

    #2
    Re: viewstate question

    Viewstate is stored in the HTML of the page. When you hit your browser's
    Back button, you are navigating to a previous version of the page, with the
    ViewState that was in it at that time.

    Is there some reason you NEED to use the Back button of your browser for
    navigation in your app?

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    All hotels in Benidorm. The best selection of Benidorm hotels with reviews and maps. Book in advance and save.

    The more I learn, the less I know.


    "Will" <wswelch@comcas t.net> wrote in message
    news:009e01c368 bb$8bd48680$a10 1280a@phx.gbl.. .[color=blue]
    > I have a form on my page. when I submit it and hit the
    > back button on my browser all of the information is gone.
    > I have enableViewState set to true in my page directive..
    > isn't that the point of it? what else do I need to do to
    > get my form to maintain it's state?
    >
    >
    > I have two methods of submitting that I've tried.. one
    > does a response.redire ct, the other hides the UserControl
    > with my form on it and shows another UC with my next page
    > on it. either way when I hit back the form is empty.
    >
    > I am prepared to store the field values in my session and
    > have my form pull them back out if they are there (when I
    > hit back), but I though this viewstate thing was supposed
    > to take care of all that for me.[/color]


    Comment

    • Will

      #3
      Re: viewstate question


      no, I was just wondering about that.. thanks

      [color=blue]
      >-----Original Message-----
      >Viewstate is stored in the HTML of the page. When you hit[/color]
      your browser's[color=blue]
      >Back button, you are navigating to a previous version of[/color]
      the page, with the[color=blue]
      >ViewState that was in it at that time.
      >
      >Is there some reason you NEED to use the Back button of[/color]
      your browser for[color=blue]
      >navigation in your app?
      >
      >--
      >HTH,
      >
      >Kevin Spencer
      >Microsoft MVP
      >..Net Developer
      >http://www.takempis.com
      >The more I learn, the less I know.
      >
      >
      >"Will" <wswelch@comcas t.net> wrote in message
      >news:009e01c36 8bb$8bd48680$a1 01280a@phx.gbl. ..[color=green]
      >> I have a form on my page. when I submit it and hit the
      >> back button on my browser all of the information is[/color][/color]
      gone.[color=blue][color=green]
      >> I have enableViewState set to true in my page[/color][/color]
      directive..[color=blue][color=green]
      >> isn't that the point of it? what else do I need to do to
      >> get my form to maintain it's state?
      >>
      >>
      >> I have two methods of submitting that I've tried.. one
      >> does a response.redire ct, the other hides the[/color][/color]
      UserControl[color=blue][color=green]
      >> with my form on it and shows another UC with my next[/color][/color]
      page[color=blue][color=green]
      >> on it. either way when I hit back the form is empty.
      >>
      >> I am prepared to store the field values in my session[/color][/color]
      and[color=blue][color=green]
      >> have my form pull them back out if they are there (when[/color][/color]
      I[color=blue][color=green]
      >> hit back), but I though this viewstate thing was[/color][/color]
      supposed[color=blue][color=green]
      >> to take care of all that for me.[/color]
      >
      >
      >.
      >[/color]

      Comment

      Working...