I have a partial view in my MVC3/Razor app for paging a grid which works fairly well currently. When I AJAXified it, I converted all the @Html.ActionLink calls to @Ajax.ActionLink. Now I want to add a DropDownList, but @Html.DropDownList doesn’t cause the AJAX section to post back, and there’s no @Ajax.DropDownList.
What can I do to get this dropdown to post back on change?
Edit: By preference, something that I can write into my own @Ajax.DropDownList helper would be best. I’m sure the jQuery-based solutions below work, and I’ll use them if necessary, but I’m sure I’m going to want this functionality elsewhere, and I’d prefer to not have all these little scripts floating around.
Here’s what I came up with – it was originally inspired by Darin’s answer, but I took it in a completely different direction.