Can we access one control Id registered in one aspx in to another ascx control,,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are in an ascx and need to access a control in the parent aspx page, you could do this as follows:
However, it is worth investigating exactly why you need to do this – in general it is not a good practice for the child user control to perform actions inside the parent page. An alternative approach would be to have the ascx throw an event in a given scenario, which the parent Page would in turn subscribe to (and potentially perform an internal action based on the event). This would allow interoperability between the page and User Control while still encapsulating each one’s functionality properly.