我有一个视图模型,该模型具有指向另一个模型的外键,基于此,我想创建一个 dropDownList,它将向我显示所选值的名称,并为我提供所有其他选项,以便我可以将其更改为我想要的任何内容。这是我的创建表单:
@using (Html.BeginForm()) {
@Html.ValidationSummary(true, "Failed creating the feed")
<fieldset>
<legend>FeedViewModel</legend>
<div class="editor-label">
@Html.HiddenFor(model => model.FeedId)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.LinkUrl)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.LinkUrl)
@Html.ValidationMessageFor(model => model.LinkUrl)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.FolderId)
</div>
<div class="editor-field">
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
我想在 Last div 处创建 dropDownList,我已经有了模型中的值。我怎样才能做到这一点?