Hi, DC Gringo,
My preferred approach is to create an interface and then implement it in all
page classes that have the mentioned controls in them. In your case the
interface will have one method in it:
Public Interface IPageWithHeader s
Public Sub SetLabelText(By Val text As String)
End Interface
Then in the implementation in each page class you will access the control in
sectionHeader (the recommended way is to expose the sectionHeaderLa bel.Text
as public string property of the sectionHeader class) and set its value to
the value of the passed parameter.
In topHeadline you will cast the Page property to your interface and call
the method:
DirectCast(Me.P age, IPageWithHeader s).SetLabelText (someValue)
Hope this helps
Martin
"DC Gringo" <dc******@visio ntechnology.net > wrote in message
news:ei******** ******@TK2MSFTN GP12.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.sec tionHeader1.sec tionHeaderLabel .Text = myVariable
In topHeadlines, I have:
Public countryName As String
Protected mainHeader1 As mainHeader
Protected sectionHeader1 As sectionHeader
(In Page Load): mainHeader1.sec tionHeader1.sec tionHeaderLabel .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