I have a database table with a computed column. The computed column merges two names (first and last) into a single display name. In the code below, I want to specify the value of the computed column, named DisplayName. How do I do this? Thanks!
FYI, this is MVC Beta 4.
<div class="editor-label">
@Html.LabelFor(model => model.PdId, "Pd")
</div>
<div class="editor-field">
@Html.DropDownList("PdId", String.Empty)
@Html.ValidationMessageFor(model => model.PdId)
</div>
Use a view model and a strongly typed view and DropDownListFor helper. Can’t see your code, so here’s an untested psuedo:
populate view model from controller
In view use the strongly typed DropDownListFor helper