Redirect to self while maintaining view state

Discussion in 'ASP .Net' started by =?Utf-8?B?amNsYXJrMDczMQ==?=, Apr 7, 2005.

  1. I am trying to redirect to the same page after a post-back is fired to ensure
    that the post-back never makes it into history (avoids the post-back/refresh
    problem). While doing this, I wish to maintain the view state of the page
    (page contains dynamic controls as well). Has anybody done this before? I
    assume that I need to store the viewstate info in session (as the 64-bit
    encoded string or as the statebag? using sql server session statehandler, not
    sure if statebag would be acceptable in that case), and then read from that
    session-stored view state when the page loads? Any help would be greatly
    appreciated.

    Thanks
    =?Utf-8?B?amNsYXJrMDczMQ==?=, Apr 7, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?amNsYXJrMDczMQ==?=

    Teemu Keiski Guest

    Hi,

    ViewState: Restore after Redirect
    http://authors.aspalliance.com/PaulWilson/Articles/Default.aspx?id=10

    --
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU

    "jclark0731" <> wrote in message
    news:...
    >I am trying to redirect to the same page after a post-back is fired to
    >ensure
    > that the post-back never makes it into history (avoids the
    > post-back/refresh
    > problem). While doing this, I wish to maintain the view state of the page
    > (page contains dynamic controls as well). Has anybody done this before? I
    > assume that I need to store the viewstate info in session (as the 64-bit
    > encoded string or as the statebag? using sql server session statehandler,
    > not
    > sure if statebag would be acceptable in that case), and then read from
    > that
    > session-stored view state when the page loads? Any help would be greatly
    > appreciated.
    >
    > Thanks
    Teemu Keiski, Apr 7, 2005
    #2
    1. Advertising

  3. This method doesn't seem to take dynamically created controls into account.

    "Teemu Keiski" wrote:

    > Hi,
    >
    > ViewState: Restore after Redirect
    > http://authors.aspalliance.com/PaulWilson/Articles/Default.aspx?id=10
    >
    > --
    > Teemu Keiski
    > ASP.NET MVP, AspInsider
    > Finland, EU
    >
    > "jclark0731" <> wrote in message
    > news:...
    > >I am trying to redirect to the same page after a post-back is fired to
    > >ensure
    > > that the post-back never makes it into history (avoids the
    > > post-back/refresh
    > > problem). While doing this, I wish to maintain the view state of the page
    > > (page contains dynamic controls as well). Has anybody done this before? I
    > > assume that I need to store the viewstate info in session (as the 64-bit
    > > encoded string or as the statebag? using sql server session statehandler,
    > > not
    > > sure if statebag would be acceptable in that case), and then read from
    > > that
    > > session-stored view state when the page loads? Any help would be greatly
    > > appreciated.
    > >
    > > Thanks

    >
    >
    >
    =?Utf-8?B?amNsYXJrMDczMQ==?=, Apr 8, 2005
    #3
  4. =?Utf-8?B?amNsYXJrMDczMQ==?=

    Teemu Keiski Guest

    If you make yourself sure that your dynamical controls participate the
    viewstatate loading and saving normally, that is they work on nomal page,
    they would work with this approach as well.

    Can you describe your scenario more accurately?
    -
    Teemu Keiski
    ASP.NET MVP, AspInsider
    Finland, EU


    "jclark0731" <> wrote in message
    news:...
    > This method doesn't seem to take dynamically created controls into
    > account.
    >
    > "Teemu Keiski" wrote:
    >
    >> Hi,
    >>
    >> ViewState: Restore after Redirect
    >> http://authors.aspalliance.com/PaulWilson/Articles/Default.aspx?id=10
    >>
    >> --
    >> Teemu Keiski
    >> ASP.NET MVP, AspInsider
    >> Finland, EU
    >>
    >> "jclark0731" <> wrote in message
    >> news:...
    >> >I am trying to redirect to the same page after a post-back is fired to
    >> >ensure
    >> > that the post-back never makes it into history (avoids the
    >> > post-back/refresh
    >> > problem). While doing this, I wish to maintain the view state of the
    >> > page
    >> > (page contains dynamic controls as well). Has anybody done this before?
    >> > I
    >> > assume that I need to store the viewstate info in session (as the
    >> > 64-bit
    >> > encoded string or as the statebag? using sql server session
    >> > statehandler,
    >> > not
    >> > sure if statebag would be acceptable in that case), and then read from
    >> > that
    >> > session-stored view state when the page loads? Any help would be
    >> > greatly
    >> > appreciated.
    >> >
    >> > Thanks

    >>
    >>
    >>
    Teemu Keiski, Apr 9, 2005
    #4
    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. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    578
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    593
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    399
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    372
    falcon
    Jul 31, 2005
  5. Bart Kastermans
    Replies:
    6
    Views:
    402
    Bart Kastermans
    Jul 13, 2008
Loading...

Share This Page