I have a @ Html.DropDownList that calls a jquery function. But he could not call the function. I tried -
$(document).ready(function () { $('.test').change(function () { alert("1"); }); }); @Html.DropDownList("PropertyContent", ViewBag.PropertyList as List<SelectListItem>, new { @class="test"})
and
function test() { alert("1"); } @Html.DropDownList("PropertyContent", ViewBag.PropertyList as List<SelectListItem>, new { onchange="test();"}) @Scripts.Render("~/bundles/jqueryval") is also included in the view
What is wrong here?
Sandy
source share