The easiest way around the asp.net control id rewriting is something like this:
var $myControl=$("#<%=MyControl.ClientID%>"); When that page is generated, the server will substitute in the real ID of the control it has generated. On Aug 18, 3:29 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I have two small questions, if anybody can help: > > 1. This was recently published concerning .NET: > > "if you have an element that has runat="server" attribute you cannot > call it directly as #loginForm because asp.net rewrites the id to > something different just doa view source on your aspx page and you > will see the renamed form cleintid " > > I was wondering how to probably implement jQuery with an ASP.NET > control considering this problem. Or do we simply need to write out: > > "ctl00_ContentPlaceHolder1_btnConfirm" to access the btnConfirm > button? > > 2) I'm also using AJAX update panel to update a gridview. Everything > is working great. However, once I update the gridview and it's > refreshed in AJAX, my jQuery no longer works, even though the code is > there. > > Has anybody had any experience with this? Thanks for the help!