示例#1
0
        // 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());
        }
示例#2
0
        public ActionResult GetTag()
        {
            TagOperate operate = new TagOperate();

            return(PartialView("~/Views/_BarPartialPage.cshtml", operate.get()));
        }