I have a list box built like so…
@Html.ListBoxFor(model => model.SelectedCalendarId, Model.PeriodList)
and have wired up a call to my controller via jQuery and hard coded value works…
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()
but no joy.
Try: