Class ValidateInputAttribute
Represents an attribute that is used to mark action methods whose input must be validated.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public class ValidateInputAttribute : FilterAttribute, IMvcFilter, IAuthorizationFilter
- Inheritance
-
ValidateInputAttribute
- Implements
- Inherited Members
Constructors
ValidateInputAttribute(bool)
Initializes a new instance of the ValidateInputAttribute class.
public ValidateInputAttribute(bool enableValidation)
Parameters
enableValidation
booltrue to enable validation.
Properties
EnableValidation
Gets or sets a value that indicates whether to enable validation.
public bool EnableValidation { get; }
Property Value
- bool
true if validation is enabled; otherwise, false.
Methods
OnAuthorization(AuthorizationContext)
Called when authorization is required.
public virtual void OnAuthorization(AuthorizationContext filterContext)
Parameters
filterContext
AuthorizationContextThe filter context.
Exceptions
- ArgumentNullException
The
filterContext
parameter is null.