Asp.Net MVC with Drop Down List, and SelectListItem Assistance
问题 I am trying to build a Dropdownlist, but battling with the Html.DropDownList rendering. I have a class: public class AccountTransactionView { public IEnumerable<SelectListItem> Accounts { get; set; } public int SelectedAccountId { get; set; } } That is basically my view model for now. The list of Accounts, and a property for returning the selected item. In my controller, I get the data ready like this: public ActionResult AccountTransaction(AccountTransactionView model) { List<AccountDto>