Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ValidationHelper.ClassFor Method

Renders an attribute that references the CSS style definition to use when validation messages for the user input element are rendered.

Namespace:  System.Web.WebPages
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)
member ClassFor : 
        field:string -> HtmlString

Parameters

field
Type: System.String
The name (value of the name attribute) of the user input element to validate.

Return Value

Type: System.Web.HtmlString
The attribute.

This method renders attributes that defines the look of the element and of any validation error messages. For information about defining CSS styles to specify the appearance of error display, see the ValidationHelper class overview.

You call this method inside the markup of an individual user input element when you are using client-side validation. (You must also have previously included the required JavaScript libraries.) When the method is invoked, it renders the appropriate attributes so that the client-side validation routines can dynamically render the CSS class elements that specify how error display is rendered.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.