我有以下下拉列表:
@Html.DropDownListFor(c => c.TargetedUser.ManagerUserID,
new SelectList(Model.UserList, "UserID", "Username",
Model.TargetedUser.ManagerUserID),
new { @name = "TargetedUser.ManagerUserID" })
在该Username
字段中,我真的很想声明用户全名,但这包含在两个字段Forename
和Surname
. 我尝试了以下方法:
@Html.DropDownListFor(c => c.TargetedUser.ManagerUserID,
new SelectList(Model.UserList, "UserID", "Forename" + "Surname",
Model.TargetedUser.ManagerUserID),
new { @name = "TargetedUser.ManagerUserID" })
但这产生了一个错误,因为它正在寻找一个名为ForenameSurname