S
Showjumper
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
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