Help w/ LoadViewState and SaveViewState subs

Discussion in 'ASP .Net' started by Showjumper, Jun 26, 2003.

  1. Showjumper

    Showjumper Guest

    Hi,
    I have implemented the istatemanager interface in control so that i can
    retrieve values from the viewstate and then update my control. The control
    is an image gallery and i want it to react to postbacks i.e a dropdown list
    of image folder choices - user selects a folder and then my control will
    display from that folder. However, in using the load and saveviewstate, the
    control doesnt work quite right. It takes 2 clicks of the button to load the
    right gallery. And then when you page the gallery reverts back to the
    original one. The problem as far asi can tell has to do w/ the these 2 subs.
    I have tried other variations which dont work at all. I hope someone has
    some ideas. How can i get the the control to behave properly. Here is the
    code:


    Protected Overrides Sub LoadViewState(ByVal savedstate As Object)
    Implements System.Web.UI.IStateManager.LoadViewState
    If Not (savedstate Is Nothing) Then
    _imagedirectory = CType(savedstate, String)
    End If
    End Sub

    Protected Overrides Function SaveViewState() As Object Implements
    System.Web.UI.IStateManager.SaveViewState
    Return _imagedirectory
    End Function
    Showjumper, Jun 26, 2003
    #1
    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. David Palfery

    saveviewstate for the entire page

    David Palfery, May 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    422
    David Palfery
    May 2, 2004
  2. tshad

    SaveViewState executing twice

    tshad, Aug 25, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    783
    tshad
    Aug 30, 2006
  3. Louis Somers

    SaveViewState called before events are fired

    Louis Somers, Aug 8, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    495
    Louis Somers
    Aug 8, 2008
  4. Stephen Miller

    Why is SaveViewState called twice in the Control Life Cycle?

    Stephen Miller, Dec 31, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    482
    Teemu Keiski
    Jan 1, 2004
  5. Teemu Keiski

    How to "track" a (child) control's ViewState / SaveViewState?

    Teemu Keiski, Apr 5, 2005, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    184
    Zarko Gajic
    Apr 6, 2005
Loading...

Share This Page