473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Help w/ LoadViewState and SaveViewState subs

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

Nov 17 '05 #1
0 3068

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Christian | last post by:
Hi, I have a Webform with 1 submit button and 1 label code behind : public class MainWebForm: System.Web.UI.Page { protected System.Web.UI.WebControls.Label lblFName; protected override...
0
by: Christian | last post by:
Hi, I have a Webform with 1 submit button and 1 label code behind : public class MainWebForm: System.Web.UI.Page { protected System.Web.UI.WebControls.Label lblFName; protected override...
5
by: William F. Robertson, Jr. | last post by:
I am having difficulty in diagnosing this problem and was throwing it out for some other eyes. I have derived my own Page class from System.Web.UI.Page and have overridden the LoadViewState...
2
by: Devin Fensterheim | last post by:
Does anyone know of an issue with a control's viewstate not persisting when dynamically adding custom controls to a web form using AddAt? If a control is added to an HTML form directly using the...
0
by: J. | last post by:
Hello, I'm trying to override the LoadViewState-method of a simple page using the .NET Framework 2.0. However, the LoadViewState-method in the code below never gets executed. The...
3
by: Peter Rilling | last post by:
Okay, I am probably missing something simple so here is my problem. I have a page. On this page I have a usercontrol. On this user control I have another usercontrol. On each usercontrol I...
5
by: Arnold | last post by:
Hi, Im building a WebCustomControl. In my principal class (Inherits from WebControl), have a property of type MyCollection (Inherits from CollectionBase), which is a MyItem collection. To mantain...
0
by: Anand Saha | last post by:
In case you are creating your own control dynamically and need to re-create them on LoadViewState, only to discover that this function is not being called by the framework, reason and...
7
by: tshad | last post by:
I thought I understood how the SaveViewState is working and was trying to use this (as per some code I found) to detect refreshes. It seemed to be working but I found that the SaveViewState was...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.