This has been asked and answered before, but unfortunately it doesn't work for me. How should I call a javascript function from an Html.DropDownListFor control in .Net MVC?
This is what I thought should work (on a partial view):
@model MySite.CultureViewModel
<script language="text/javascript">
function ChangeCulture() {
alert("please work");
};
</script>
@using(Html.BeginForm())
{
@Html.DropDownListFor(m => m.SelectedLanguageId, Model.LanguageSelector, new { onchange = "ChangeCulture();" })
}
What am I doing wring?