Share via


HtmlHelper.ValidationMessageValidCssClassName Property

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

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

Syntax

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

value = HtmlHelper.ValidationMessageValidCssClassName 

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

Property Value

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

Remarks

When you use the ValidationMessage method, ASP.NET always renders markup for the message, even if validation passes. To control the appearance of the message (including suppressing it) when validation passes, you can define 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