MVC 下拉框

            <div class="form-group">
                @Html.LabelFor(model => model.Lesson_id, "Lesson_id", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.DropDownList("Lesson_id", null, htmlAttributes: new { @class = "form-control" })
                    @Html.ValidationMessageFor(model => model.Lesson_id, "", new { @class = "text-danger" })
                </div>
            </div>

  

        public ActionResult Create_Course()
        {
            ViewBag.Coupon_id = new SelectList(db.kywkt_Coupon, "Id", "Code");
            ViewBag.Lesson_id = new SelectList(db.kywkt_Lesson, "LID", "Title");
            return View();
        }

MVC5 DropDownList使用 注意位置

@Html.DropDownList("Lesson_id", 


posted @ 2016-03-08 20:12  IT马叔  阅读(698)  评论(0编辑  收藏  举报