【发布时间】:2017-12-13 12:43:53
【问题描述】:
在DropDownListFor 上有一个changeEvent,它会触发事件的代码,但是所选项目为空,即$(this).val(); 是null
查看:
<script>
$(function () {
$("#selected_listBulletinBoardsMessages").change(function (e) {
var val = $(this).val();
..
});
});
</script>
<div>
<div id="selected_listBulletinBoardsMessages">
@Html.DropDownListFor(model => model.listBulletinBoardsMessages, Model.listBulletinBoardsMessages.Select(b => new SelectListItem() { Value = b.Department, Text = b.Department }), "All Departments", new { @class = "form-control" })
</div>
</div>
我做错了什么?
【问题讨论】:
标签: jquery asp.net-mvc asp.net-mvc-3 asp.net-mvc-5