C#与form表单 控制器设置select默认选项

        private SelectList GetMenusTypes(string defaultType = "")
        {
            Dictionary<string, string> dic_type = new Dictionary<string, string>() { };

            dic_type.Add("Website", "网站开发");
            dic_type.Add("WxOffice", "公众号开发");
            dic_type.Add("WxProgram", "小程序开发");


            return new SelectList(dic_type, "Key", "Value", defaultType);
        }

 

posted @ 2018-08-31 11:38  德丽莎·阿波卡利斯  阅读(203)  评论(0编辑  收藏  举报