Re: Best way to pass variable between page and control

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John Saunders (johnwsaundersiii)
Date: 12/28/04


Date: Tue, 28 Dec 2004 14:30:20 -0500


"darrel" <notreal@hotmail.com> wrote in message
news:O%23QTB3Q7EHA.3120@TK2MSFTNGP12.phx.gbl...
> I'm still trying to fully understand how best to pass variables between
> pages/usercontrols/each other.
>
> On a current site I've done, I've had one userControl do the logic and set
> the variable, and then I had other usercontrols simply read this by
> traversing the class structure:
> siteClass.userControlClass.specficVariable.

Your page and your UserControl are both instances of classes. These classes
can have properties. The page can pass data to a UserControl by setting
properties of the UserControl.

John Saunders