My difficulty is how to use ViewBag
with DropdownListFor
?
In my controller I am having:
TestModel model = new TestModel();
ViewBag.Clients = model.Clients;
ViewBag.StatusList = model.StatusList;
ViewBag.enumStatus = model.enumStatus;
ViewBag.intClient = model.intClient;
In my TestModel
public SelectList Clients { get; set; }
public SelectList StatusList { get; set; }
public ActiveStatus enumStatus { get; set; }
public int? intClient { get; set; }
In my View
I want to use DropDownListFor
to display the ViewBag values, how can I do that?