im using razor syntax i want to set value =0 if dropdown is not selected or drop down text is 'select one' and i have multiple dropdowns..and im getting this value by form collection
@Html.DropDownListFor(model => item.JobStaffId, (SelectList)newSelectStaffList,new { @class = "form-control js-select js-noFilter hidden DDStaff DD2 ",multiple="multiple", size = "2", Id = "JobStaffId" + t })
SelectList newSelectList = new SelectList((from s in Model.UserMasterList
.ToList()
select new
{
userId = s.userId,
userName = (s.userFirstName +' '+ s.userLastName)
}).Distinct()
,
"userId",
"userName",
string.IsNullOrEmpty(item.JobConstructionManagerId.ToString()) ? 0 : item.JobConstructionManagerId);