How to access or get reference of control in UpdatePanel through javascript?
How to access or get reference of control in UpdatePanel through javascript?
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.
A control in an
UpdatePanelis no different than a control on any other page so you can access them in the same way. The difference is that anUpdatePanelcan have new controls added constantly with no easy way for you to get theClientIDof the control on the fly as theUpdatePanelupdates. In these cases I have used a unique style name (style doesn’t have to have any details, it’s just used as a tag in this case) and access it using jQuery’s style accessor. It’s not very often that I have to resort to this method but when I have had to style names were sufficient.EDIT:
In your control add the following to the CssClass:
Then with javascript using jQuery you can access the control with the css class name directly like so and read the value:
Hope that helps.