标签:value request model var name color lis 添加 list
[Required] [DisplayName("112")]
model里面添加字段
var errs = new List<string>(); if(ModelState.IsValid) return Json(save, JsonRequestBehavior.AllowGet); else foreach (var state in ModelState) { foreach (var err in state.Value.Errors) { errs.Add(err.ErrorMessage);//把错误添加到数组里 } } return Json(string.Join(",",errs), JsonRequestBehavior.AllowGet);
标签:value request model var name color lis 添加 list
原文地址:https://www.cnblogs.com/LiuFengH/p/11386780.html