我有一个像这样的名单箱......
@Html.ListBoxFor(model => model.SelectedCalendarId, Model.PeriodList)
并且通过 j和硬编码价值工作向我的控制员发出呼吁......
var calId = 12;
$.getJSON("/Publishing/GetLockState1", { calendarId: calId }, function (data) {//omitted}
so now, how do I get the Id the user has selected to pass into the json call, i.e. how to populate calId ? I tried
calId = $("#SelectedCalendarId").val()
但不欢迎。