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