Share via


AcceptAttribute Class

 

Represents an attribute that accepts the validation of value.

Namespace:   Microsoft.Web.Mvc
Assembly:  Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)

Inheritance Hierarchy

System.Object
  System.Attribute
    System.ComponentModel.DataAnnotations.ValidationAttribute
      System.ComponentModel.DataAnnotations.DataTypeAttribute
        Microsoft.Web.Mvc.AcceptAttribute

Syntax

[AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple = false)]
public sealed class AcceptAttribute : DataTypeAttribute, IClientValidatable
[AttributeUsageAttribute(AttributeTargets::Property, AllowMultiple = false)]
public ref class AcceptAttribute sealed : DataTypeAttribute, 
    IClientValidatable
[<Sealed>]
[<AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple = false)>]
type AcceptAttribute = 
    class
        inherit DataTypeAttribute
        interface IClientValidatable
    end
<AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple := False)>
Public NotInheritable Class AcceptAttribute
    Inherits DataTypeAttribute
    Implements IClientValidatable

Constructors

Name Description
System_CAPS_pubmethod AcceptAttribute()

Initializes a new instance of the AcceptAttribute class.

Properties

Name Description
System_CAPS_pubproperty CustomDataType

(Inherited from DataTypeAttribute.)

System_CAPS_pubproperty DataType

(Inherited from DataTypeAttribute.)

System_CAPS_pubproperty DisplayFormat

(Inherited from DataTypeAttribute.)

System_CAPS_pubproperty ErrorMessage

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty ErrorMessageResourceName

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty ErrorMessageResourceType

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty MimeTypes

Gets or sets the acceptance value for the mime types.

System_CAPS_pubproperty RequiresValidationContext

(Inherited from ValidationAttribute.)

System_CAPS_pubproperty TypeId

(Inherited from Attribute.)

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Attribute.)

System_CAPS_pubmethod FormatErrorMessage(String)

Applies formatting to an error message based on the data field where the acceptance error occurred.(Overrides ValidationAttribute.FormatErrorMessage(String).)

System_CAPS_pubmethod GetClientValidationRules(ModelMetadata, ControllerContext)

Gets a list of acceptance value client validation rules for the property using the specified model metadata and controller context.

System_CAPS_pubmethod GetDataTypeName()

(Inherited from DataTypeAttribute.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod GetValidationResult(Object, ValidationContext)

(Inherited from ValidationAttribute.)

System_CAPS_pubmethod IsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethod IsValid(Object)

Determines whether the specified value is valid.(Overrides DataTypeAttribute.IsValid(Object).)

System_CAPS_pubmethod Match(Object)

(Inherited from Attribute.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod Validate(Object, String)

(Inherited from ValidationAttribute.)

System_CAPS_pubmethod Validate(Object, ValidationContext)

(Inherited from ValidationAttribute.)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

(Inherited from Attribute.)

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.Web.Mvc Namespace

Return to top