Как передать значение из столбца множественного выбора из представления в метод Get контроллера.Я пытаюсь передать значение из dropdownDepot в список аргументов контроллера.Пожалуйста, помогите
public class ReportViewModel
{
public int DepotNo { get; set; }
public List<int> Department { get; set; }
}
[HttpGet]
public IActionResult EmployeeView(ReportViewModel report, List<int> Department,int DepotNo = 0)
{
List<EmployeeWorkTimeSettingsModel> log = new List<EmployeeWorkTimeSettingsModel>();
log = ReportService.GetDepotEmployeeWorkHrsReport(connectionSettings, (HttpContext.Session.GetInt32("UserID") ?? 0).ToString(),
String.Join(",", report.DepotNo), String.Join(",", report.Department));
ViewBag.EmpviewReport = log;
}
<div class="controls col-sm-9">
<select asp-for="DepotNo" class="form-control" id="dropdownDepot" asp-items="@ViewBag.UserDepots" onchange="FillEmployee()" data-role="select"></select>
<span asp-validation-for="DepotNo" class="text-danger"></span>
</div>
<div class="controls col-sm-9">
<select id="dropdownDepartment" class="form-control" asp-for="Department" asp-items="@ViewBag.UserDepartments" onchange="FillEmployee()"
data-role="select"></select>
</div>
$('#dropdownDepartment').multiselect({
columns: 1,
placeholder: 'Select Department',
includeSelectAllOption: true,
maxHeight: 300
});
function FillEmployee() {
var href = '/Report/EmployeeView?depot=' + $("#dropdownDepot option:selected").val() + '&department=' + Get the Value from multiselect departments;
$("#lnkFilter").attr('href', href);
$("#lnkFilter").click();
}