Can the ViewBag name be the same as the Model property name in a DropDownList?

You should not use the same name for the model property and the ViewBag property (and ideally you should not be using ViewBag at all, but rather a view model with a IEnumerable<SelectListItem> property). When using @Html.DropDownListFor(m => m.CustomerId, ….) the first “Please Select” option will always be selected even if the value of the … Read more