I write Asp.Net MVC application and whant to realize cascading drop down lists functionality, but I have problem with jQuery change event. Where am I wrong?
Javascript:
<script charset="utf-8" type="text/javascript" language="javascript" src="<%= Url.Content("~/Content/jquery-1.4.1.js") %>"></script>
<script charset="utf-8" type="text/javascript" language="javascript">
$(document).ready(function () {
$("#ddlCategories").change(function () { alert("It worked!"); });
});
</script>
MVC:
<%=Html.DropDownList("CategoriesId", (SelectList)ViewData["CategoriesList"], new { Id = "ddlCategories" })%>
<%=Html.DropDownList("ModelId", (SelectList)ViewData["ModelsList"], new { Id = "ddlModels" })%>
HTML:
<select name="CategoriesId" id="ddlCategories">
<option value="1">Thermage Solta Medical</option>
<option value="2">Syneron</option>
<option value="59">Deka</option>
</select>
<select name="ModelId" id="ddlModels">
<option value="1">Thermage NXT RF</option>
<option value="2">Thermacool TC</option>
</select>