Help w/ LoadViewState and SaveViewState subs

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top