D
darrel
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.
That worked fine.
The new site I'm working on is a bit different, as I'm using multiple
usercontrols on multiple 'subsites' The 'subsite.aspx' page is the page that
will contain the variable.
The structure is like this:
projectClass
- subsite1.aspx
- - uses usercontrol1
- - uses usercontrol2
- subsite2.aspx
- - uses usercontrol1
- - uses usercontrol2
Let's say I have a variable of subsite="1" that I set on the
subsite1.aspx.vb page.
I know what usercontrol1 and usercontrol2 to read that when they load.
Can I simply traverse up the class and grab it on each load? The catch is
that the usercontrol doesn't know what page is loading it at any given time.
I need something like: page.parent.subsite
Or, is there a better way to go about doing this?
-Darrel
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.
That worked fine.
The new site I'm working on is a bit different, as I'm using multiple
usercontrols on multiple 'subsites' The 'subsite.aspx' page is the page that
will contain the variable.
The structure is like this:
projectClass
- subsite1.aspx
- - uses usercontrol1
- - uses usercontrol2
- subsite2.aspx
- - uses usercontrol1
- - uses usercontrol2
Let's say I have a variable of subsite="1" that I set on the
subsite1.aspx.vb page.
I know what usercontrol1 and usercontrol2 to read that when they load.
Can I simply traverse up the class and grab it on each load? The catch is
that the usercontrol doesn't know what page is loading it at any given time.
I need something like: page.parent.subsite
Or, is there a better way to go about doing this?
-Darrel