G
gnewsgroup
In my user control, I would like to find a Label control in the parent
page (the page that uses my user control). I need to update that
Label.Text when something happens in the user control.
I don't want to go through the hassle of creating events in the user
control, and then let the parent handle the event.
What is the easiest way to find a control in the parent page? Right
now, I am simply manually traversing it from the user control up to
the parent page and print out the control ID until I find the one I am
looking for.
In other words, in the user control, I am looking for the control in
the parent page like this:
lblControlID.Text = this.Parent.Parent.Parent.ID.ToString();
until I have appended enough ".Parent" and get the control ID.
This is very stupid, any wise approach?
Thank you.
page (the page that uses my user control). I need to update that
Label.Text when something happens in the user control.
I don't want to go through the hassle of creating events in the user
control, and then let the parent handle the event.
What is the easiest way to find a control in the parent page? Right
now, I am simply manually traversing it from the user control up to
the parent page and print out the control ID until I find the one I am
looking for.
In other words, in the user control, I am looking for the control in
the parent page like this:
lblControlID.Text = this.Parent.Parent.Parent.ID.ToString();
until I have appended enough ".Parent" and get the control ID.
This is very stupid, any wise approach?
Thank you.