asp.net mvc - ModelState is coming false even when I've modified the property in action filter -


Text after "itemprop =" text ">

I have modified the ActionType itself in the following action filters but still getting the model state error as" Field ActionType Regular Expression '1 | 2 | 3 | 4'. "

As for [Regular Expression (" 1 | 2) | 3 | 4 ")] Public Ent Action Type {get; Set; }

My ActionType Enum is

  public enum ActionType {pair = 1, update = 2, delete = 3, find = 4}   

action filter

  public override is zero OnActionExecuting (System.Web.Http.Controllers.HttpActionContext actionContext) {var formData = actionContext.ActionArguments.FirstOrDefault (). Value EntityBase; If (formData! = Null) {string methodType = actionContext.Request.Method.Method; Switch (methodType.ToUpper ()) {case "POST": formData.ActionType = (int) ActionType.Add; break; Case "PUT": formData.ActionType = (int) ActionType.Update; break; Case "DELETE": formData.ActionType = (int) ActionType.Delete; break; Case "Received": formData.ActionType = (At) Action Tap Search; break; // your errors}} base.OnActionExecuting (actionContext); } Text after "

You use the regular expression instead of the range to change the data annotation on the ActionType property Can you? ? [Category (1, 4)] Public Ent Action Type {get; Set; }

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -