This can also be caused if your Model is using a SelectList, as this has no parameterless constructor:
public class MyViewModel
{
public SelectList employeeList {get;set;}
}
You'll need to refactor your model to do it a different way if this is the cause. So using anIEnumerable<SelectListItem>
and writing an extension method that
creates the drop down list with the different property definitions:
public class MyViewModel
{
public IEnumerable<SelectListItem> employeeList { get; set; }
}
Perfect solution !
No comments:
Post a Comment