asp.net - How to access control in UpdatePanel through javascript? -


how access or reference of control in updatepanel through javascript?

a control in updatepanel no different control on other page can access them in same way. difference updatepanel can have new controls added no easy way clientid of control on fly updatepanel updates. in these cases have used unique style name (style doesn't have have details, it's used tag in case) , access using jquery's style accessor. it's not have resort method when have had style names sufficient.

// control specific style $(".yourcontrolsuniquestylename") 

edit:

in control add following cssclass:

<asp:textbox id="textbox1" runat="server" cssclass="yourcontrolsuniquestylename"></asp:textbox> 

then javascript using jquery can access control css class name directly , read value:

var textbox1value = $(".yourcontrolsuniquestylename").val(); 

hope helps.


Comments