В: Как я могу отобразить имя и фамилию (или любой строковый литерал) в выпадающем списке mvc3, но сохранить привязанный / связанный идентификатор при выборе элемента?
- Контроллер
// This is what I have to display as username but want to display as FirstName + LastName
// .: How to I change "Username" to FirstName + LastName but bind it to the selected UserTId ???
ViewBag.ContactUserId = new SelectList(db.UserTs, "UserTId", "Username");
- Просмотр
@Html.DropDownList("ContactUserId", "--Select a contact--")