HtmlHelper.ValidationMessageCssClassName Property

Gets or sets the name of the CSS class that defines the appearance of validation error messages when validation fails.

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Shared Property ValidationMessageCssClassName As String 
    Get 
    Set
'Usage
Dim value As String 

value = HtmlHelper.ValidationMessageCssClassName 

HtmlHelper.ValidationMessageCssClassName = value
public static string ValidationMessageCssClassName { get; set; }
public:
static property String^ ValidationMessageCssClassName {
    String^ get ();
    void set (String^ value);
}
static member ValidationMessageCssClassName : string with get, set
static function get ValidationMessageCssClassName () : String 
static function set ValidationMessageCssClassName (value : String)

Property Value

Type: System.String
The name of the CSS class. The default is field-validation-error.

Remarks

When you use the ValidationMessage method, you can control the appearance of the message when validation fails by defining a CSS class. You can then set this property to the name of the class. At run time, the property value is set as the class attribute of the rendered markup.

See Also

Reference

HtmlHelper Class

System.Web.WebPages.Html Namespace