Untitled

Anonymous
plain_text
05/31/2023 3:03 PM
488 B
15
Indexable
public class CheckModelStateActionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            if (!context.ModelState.IsValid)
            {
                context.Result = new ViewResult();
            }

            base.OnActionExecuting(context);
        }
    }
Editor is loading...