E
eagle
How do I access a control, like a placeholder, from another page, or another
user control that may be on the same page.
For instance, I have a web page with 2 user controls. One user controls
contains a placeholder to that will contain any error messages to be
displayed. If the first user control creates an error, I want to be able to
push that error to the 2nd control to display it at the placeholder.
I have tried
Dim ctrlError as new ucErrors
Dim lbl as new label
lbl.text = "Error has occurred"
ctrlError.ph.Controls.Add(lbl)
But I get an error saying "System.NullReferenceException: Object reference
not set to an instance of an object."
user control that may be on the same page.
For instance, I have a web page with 2 user controls. One user controls
contains a placeholder to that will contain any error messages to be
displayed. If the first user control creates an error, I want to be able to
push that error to the 2nd control to display it at the placeholder.
I have tried
Dim ctrlError as new ucErrors
Dim lbl as new label
lbl.text = "Error has occurred"
ctrlError.ph.Controls.Add(lbl)
But I get an error saying "System.NullReferenceException: Object reference
not set to an instance of an object."