// GET: Article public ActionResult Create() { TagOperate tagO = new TagOperate(); List <TagModel> tag = tagO.get(); List <SelectListItem> list_Item = new List <SelectListItem>(); int count = tag.Count(); for (int i = 0; i < count; i++) { list_Item.Add(new SelectListItem { Text = tag[i].Name, Value = Convert.ToString(tag[i].Id) }); } ViewBag.TagList = new SelectList(list_Item, "Value", "Text", ""); return(View()); }
public ActionResult GetTag() { TagOperate operate = new TagOperate(); return(PartialView("~/Views/_BarPartialPage.cshtml", operate.get())); }