【发布时间】:2019-05-16 05:47:26
【问题描述】:
这里出现问题:
@Html.DropDownList("KategoriId", null, htmlAttributes: new { @class = "form-control" })
这是我的控制器:
public ActionResult Create()
{
ViewBag.KategoriId = new SelectList(db.Kategoris, "KategoriId", "KategoriAdi");
return View();
}
这是我的观点:
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.KategoriId, "KategoriId", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("KategoriId", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.KategoriId, "", new { @class = "text-danger" })
</div>
</div>
【问题讨论】:
-
欢迎来到 Stack Overflow!你能进一步解释你的问题吗?我建议你阅读stackoverflow.com/help/how-to-ask。
标签: c# asp.net-mvc