Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help w/ LoadViewState and SaveViewState subs

Reply
Thread Tools

Help w/ LoadViewState and SaveViewState subs

 
 
Showjumper
Guest
Posts: n/a
 
      06-26-2003
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveViewState called before events are fired Louis Somers ASP .Net 0 08-08-2008 10:06 AM
SaveViewState executing twice tshad ASP .Net 7 08-29-2006 11:10 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
saveviewstate for the entire page David Palfery ASP .Net 2 05-02-2004 04:48 PM
Why is SaveViewState called twice in the Control Life Cycle? Stephen Miller ASP .Net Building Controls 1 01-01-2004 11:12 AM



Advertisments