下拉列表 MVC DropDownList

ViewBag.CategoryId = new SelectList(db.Categories, "Id", "Name","默认值");

        <div class="editor-label">
            @Html.LabelFor(model => model.CategoryId, "Category")
        </div>
        <div class="editor-field">
            @Html.DropDownList("CategoryId", String.Empty)
            @Html.ValidationMessageFor(model => model.CategoryId)
        </div>

下拉列表 MVC DropDownList,布布扣,bubuko.com

下拉列表 MVC DropDownList

上一篇:《HTML5编程之旅》系列二:Communication 技术初探


下一篇:java 错误:Access restriction: The type Resource is not accessible due to restriction on required library