JQuery selectors with ASP.NET controls
I am trying to make sense of the selectors in JQuery when using it with ASP.NET 3.5. In this .NET version the server modifies the control ids when it creates the page. I have seen two methods of selecting a control as shown below where dd is the control id.
1. var SelectVal = $("input[id *=_dd]").val();
2. var SelectVal = $('#<%=dd.ClientID%>').val();
Method 1 works well with asp.net textbox controls but does not work with asp.net dropdown lists. Method 2 seems to work with all control types. Can anyone explain this?