J
Jon Hyland
This might be a dumb question, but what is the best way for one
instance of a user control to access properties of an instance of
another user control?
For example, let's say I have an instance of UserControlA (ucA1) and
an instance of UserControlB (ucB1) on a particular ASP.NET page.
UserControlA has a string property called StringA that gets generated
from a DB call in it's Page_Load event. I want UserControlB to be
able to access UserControlA's StringA property in its Page_Load event
(which gets fired afterward). How would you do this?
Would you need to create a page level variable and assign the value to
this? Is it even possible for a user control to access its
container's objects?
I want to avoid using Session variables here.. the text contained in
this string should not persist in memory beyond the page call.
Thanks in advance!
instance of a user control to access properties of an instance of
another user control?
For example, let's say I have an instance of UserControlA (ucA1) and
an instance of UserControlB (ucB1) on a particular ASP.NET page.
UserControlA has a string property called StringA that gets generated
from a DB call in it's Page_Load event. I want UserControlB to be
able to access UserControlA's StringA property in its Page_Load event
(which gets fired afterward). How would you do this?
Would you need to create a page level variable and assign the value to
this? Is it even possible for a user control to access its
container's objects?
I want to avoid using Session variables here.. the text contained in
this string should not persist in memory beyond the page call.
Thanks in advance!