Backend:
ViewBag.title = “Mr.Ba.Code”;
ViewData[“title”] = “Mr.Ba.Code”;
Frontend:
@Html.TextBox(“title”)
Backend:
ListfakeData = new List ();
fakeData.AddRange(Enumerable.Range(0, 10));
SelectList selectList = new SelectList(fakeData);
ViewBag.dropdownSource = selectList;
Frontend:
@Html.DropDownList((SelectList)ViewBag.dropdownSource);
沒有留言:
張貼留言