Your problem is that topHeadline doesn't know anything about mainHeader1 and
sectionHeader1....they are defined in the page, not topheadline. The trick
is to go through the page.
The page should have
public mainHeader1 as Mainheader
public sectionHeader1 as sectionHeader
your topHeadline should do:
ctype(Page, TYPEOFYOURPAGE).mainHeader1.sectionHeaderLabel.Tex t = myVariable
Also consider doing a pull (making the mainHeader1 get the data from
topheadline) instead of a push (passing the data from topheadline to
mainHeader1). Seems to me you have business logic in your presentation
layer. Whatever this data is that both user controls need should be placed
in a separate class and caching should be used (if appropriate)
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:OK**************@TK2MSFTNGP15.phx.gbl...
I am a bit twisted and need some straightening out. I have a webform with
3 controls on it: a mainHeader, a sectionHeader with a label control
contained in the mainHeader, and a topHeadline.
In the topHeadline, I am retrieving a value with a stored procedure. I
need to set that value to a label control within the sectionHeader like this:
mainHeader1.sectionHeader1.sectionHeaderLabel.Text = myVariable
In topHeadlines, I have:
Public countryName As String
Protected mainHeader1 As mainHeader
Protected sectionHeader1 As sectionHeader
(In Page Load): mainHeader1.sectionHeader1.sectionHeaderLabel.Text =
myVariable
The error I get is: "Object reference not set to an instance of an
object."
What am I doing wrong?
_____
DC G
--
_____
DC G