I'm trying to find a label on an aspx page from a user control (ascx) on said aspx page. Obviously Page.FindControl("lablel1") is not working. Do I need to add in ClientID somewhere? Thanks.
I think you ought to stop and think about your design. Your controls should not ever need to know anything about the page that contains them - the fact that you need to go find a control on the page from within another control tells me that you ought to rethink the problem.
The best thing I can tell you (with what little I know of your architecture) is that you ought to pass in a reference to the control you hope to find into your user control. This way your control does not have to know about things outside itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With