I have been a Prototype and Scriptaculous user for over a year now. But I am starting the transition over to jQuery, and am loving what I see. The learning curve is easy if you’re coming in from one of the other frameworks, so don’t sweat it.
The ASP Trick
The jQuery part of this function is shown in blue here: $(‘#<%=DropDownList1.ClientID %>‘).val()
Using the function is as simple as:
var myValue = getDropDownList1Value();
This could, of course, be used with any ASP.net server control for other purposes as well.
A jQuery Alternative: The CSS Class Selector
Another alternative with jQuery, would be to assign a css class to the control and use that class as your selector. Here’s a jQuery example to select on a css class called mydropdown:
Just assign the mydropdown class to your ASP control in Visual Studio and jQuery will find your control. But be careful…jQuery will find every control that has that class, so give a unique class to each control you want to try this with.
Hope that helps.