在过滤器中得到模型状态信息

public class DataValidateFilterAttribute : ActionFilterAttribute { 
public override void OnActionExecuting(ActionExecutingContext filterContext) { StringBuilder sb = new StringBuilder(); var modelStates= filterContext.Controller.ControllerContext.Controller.ViewData.ModelState; 

} 

}

 

posted @ 2018-02-01 12:56  夏风微凉  阅读(128)  评论(0编辑  收藏  举报