Html.DropDownList 选中 mvc view 弱类型

2020-12-13 03:54

阅读:340

标签:c   ext   a   html   htm   name   

 List listGroup = sysGroupBll.Where(o => o.IsSb == true, o => o.Id).ToList();
            List items = new List();
            foreach (var group in listGroup)
            {
                items.Add(new SelectListItem { Text = group.Name, Value = group.Id });
            }
            this.ViewData["list"] = items;
            this.ViewData["GroupId"] = CurrentUser.SysGroup.FirstOrDefault().Id;

 

 

 

组 @Html.DropDownList("GroupId", ViewData["list"] as IEnumerable)

Html.DropDownList 选中 mvc view 弱类型,搜素材,soscw.com

Html.DropDownList 选中 mvc view 弱类型

标签:c   ext   a   html   htm   name   

原文地址:http://www.cnblogs.com/huhaihua/p/3729721.html


评论


亲,登录后才可以留言!