Adding Create View (2)

How about displaying the Genre items on dropdown list?

In the previous project, we were being helped by ViewBag. Today, there is another approach. Remember that we already declared selectlist item on Song model? Therefore, we could just call it.

<div class="editor-label">
@Html.LabelFor(model => model.GenreId)
</div>

<div class="editor-field">
@Html.DropDownListFor(model => model.GenreId, Model.Genres)
</div>

results matching ""

    No results matching ""