Export (0) Print
Expand All

HtmlHelper.ValidationMessage Method

Returns an HTML span element that represents a validation error message for use in a web page.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method ValidationMessage(String) Returns an HTML span element that contains the first validation error message for the specified form field.
Public method ValidationMessage(String, IDictionary<String, Object>) Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains the first validation error message for the specified form field.
Public method ValidationMessage(String, Object) Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains the first validation error message for the specified form field.
Public method ValidationMessage(String, String) Returns an HTML span element that contains a validation error message for the specified form field.
Public method ValidationMessage(String, String, IDictionary<String, Object>) Returns an HTML span element that has the specified custom attributes defined by an attribute dictionary, and that contains a validation error message for the specified form field.
Public method ValidationMessage(String, String, Object) Returns an HTML span element that has the specified custom attributes defined by an attribute object, and that contains a validation error message for the specified form field.
Top

This method is used in conjunction with the System.Web.Helpers.Validation class.

The HTML span element is returned as HTML markup that can be used to render the validation error message in a web page.

Show:
© 2014 Microsoft