Help with User Control & State

  • Thread starter Thread starter Paul Say
  • Start date Start date
P

Paul Say

Here is the seniaro,

I have a user control consisting of a list of 3 Companies. e.g
1 - Company A
2 - Company B
3 - Company C - These are read from a data base and may increase in the
future.

What I wan to be able to do is have the control rember its state. with
regards to the following
1) Rember the selected company between page calls (the control will be used
on some but not all of the webpages)
2) Rember the selected company when the user returns to the site after a new
login.
3) I also currently have a class that contains a Public Shared Property,
Class Company
Public Shared Property Selected()
Return 1
End Property
End Class

A number of different pages use this Property in stored procedures,
functions etc. So the public property of this class also needs to be able
to get the value.


Just looking for Ideas on the best practice to tackle this problem


Paul
 
a couple of suggestions..

1) store it in viewstate (makes the page bigger for downloads)

2) store in sesssion var.(make sure your session key is unique.... using a
GUID can be a good idea for sessin vars that are used in controls...)
 
Back
Top