![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
Hi How about "ClientID" property ? --------- Please vote "yes" Adlai Maschiachhttp://blogs.microsoft.co.il/blogs/adlaim/ |
#4
| |||
| |||
|
|
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. |
#5
| |||
| |||
|
|
Hi How about "ClientID" property ? --------- Please vote "yes" Adlai Maschiachhttp://blogs.microsoft.co.il/blogs/adlaim/ g> Thanks, but I don't quite understand your strategy. |
#6
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |