VerificationAttribute Class
Assembly: System.Web (in system.web.dll)
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true) */ public final class VerificationAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Property, AllowMultiple=true) public final class VerificationAttribute extends Attribute
Not applicable.
An instance of the VerificationAttribute class defines a Web content accessibility rule that can be verified. For more information on Web Content Accessibility Guidelines, see the World Wide Web Consortium (W3C) Web site.
The minimal amount of information required to define an instance of a VerificationAttribute includes:
-
A guideline that the verification rule represents. The value specified in the constructor sets the Guideline property.
-
A checkpoint of the guideline. The value specified in the constructor sets the Checkpoint property.
-
A checkpoint priority. The value specified in the constructor sets the Priority property.
-
A VerificationReportLevel enumeration value that represents the reporting level that should be rule belongs to. The value specified in the constructor sets the VerificationReportLevel property.
-
A message that is reported when the verification rule is true. The value specified in the constructor sets the Message property.
Optional properties of the verification rule that can be specified when creating an instance:
-
A VerificationRule enumeration value that represents how the verification rule should be interpreted. The value specified in the constructor sets the VerificationRule property.
-
A VerificationConditionalOperator enumeration value that represents the operator in the conditional expression used to test the verification rule. The value specified in the constructor sets the VerificationConditionalOperator property.
-
An accessibility reference guideline URL. The value specified in the constructor sets the GuidelineUrl property.
-
A conditional value representing the right side of a conditional expression. The value specified in the constructor sets the ConditionalValue property.
-
A conditional property representing the left side of a conditional expression. The value specified in the constructor sets the ConditionalProperty property.
The VerificationAttribute metadata can be defined class, property, and indexer declarations.
For more information about using attributes, see Extending Metadata Using Attributes.
The following code example demonstrates using the VerificationAttribute class. In the verification metadata definition, the guidelines used are "WCAG," the Web Content Accessibility Guideline, and "ADA," Americans with Disabilities Act Guidelines. For more information, see the World Wide Web Consortium (W3C) Web site.
The checkpoints used are "1.1" and "1194.22(a)" for WCAG and ADA, respectively, checkpoints for ensuring that a text equivalent exists for non-text elements. The VerificationAttribute is applied to the ImageText property that represents the text equivalent of another property called ImageProperty. If the ImageText property is not set, the accessibility verification will return the message "The image is missing a text equivalent."
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
Reference
VerificationAttribute MembersSystem.Web.UI Namespace