I know the dropdown list data is coming from the viewBag not model , thats why model doesnt validate the particular dropdown list while it validates other fields which are linked to model, Just want to know, how can i validate the above dropdownlist
This doesnt works on (ModelState.IsValid)
Controller
var td = tabladatos.GetAll();
var estadossol = (from item in td
where item.Relacion == "EstadoSolicitud" && !(item.Valor == 1 || item.Valor == 3 || item.Valor == 4 || item.Valor == 5)
orderby item.Orden ascending
select item).ToList();
ViewBag.EstadoSolicitud = new SelectList(estadossol, "Valor", "Descripcion", "2");
View
@Html.DropDownList("EstadoSolicitud", null, "", new { @class = "select2_single form-control" })
@Html.ValidationMessageFor(model => model.EstadoSolicitud)