ValidationExtensions.ValidationMessage ValidationExtensions.ValidationMessage Method

Definition

Overloads

ValidationMessage(HtmlHelper, String, String, Object, String) ValidationMessage(HtmlHelper, String, String, Object, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>, String) ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String, String) ValidationMessage(HtmlHelper, String, String, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String, Object) ValidationMessage(HtmlHelper, String, String, Object)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>) ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, Object, String) ValidationMessage(HtmlHelper, String, Object, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, IDictionary<String,Object>, String) ValidationMessage(HtmlHelper, String, IDictionary<String,Object>, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String) ValidationMessage(HtmlHelper, String, String)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, Object) ValidationMessage(HtmlHelper, String, Object)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, IDictionary<String,Object>) ValidationMessage(HtmlHelper, String, IDictionary<String,Object>)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String) ValidationMessage(HtmlHelper, String)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

ValidationMessage(HtmlHelper, String, String, Object, String) ValidationMessage(HtmlHelper, String, String, Object, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage, object htmlAttributes, string tag);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string * obj * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method operates on.

modelName
String String

The name of the entry being validated.

validationMessage
String String

The message to display if the specified entry contains an error.

htmlAttributes
Object Object

An object that contains the HTML attributes for the element.

tag
String String

The tag to be set for the wrapping HTML element of the validation message.

Returns

null if the entry is valid and client-side validation is disabled. Otherwise, a tag element that contains an error message.

ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>, String) ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage, System.Collections.Generic.IDictionary<string,object> htmlAttributes, string tag);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string * System.Collections.Generic.IDictionary<string, obj> * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method operates on.

modelName
String String

The name of the model object being validated.

validationMessage
String String

The message to display if the specified entry contains an error.

htmlAttributes
IDictionary<String,Object>

An IDictionary<TKey,TValue> that contains the HTML attributes for the element.

tag
String String

The tag to be set for the wrapping HTML element of the validation message.

Returns

null if the model object is valid and client-side validation is disabled. Otherwise, a tag element that contains an error message.

ValidationMessage(HtmlHelper, String, String, String) ValidationMessage(HtmlHelper, String, String, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage, string tag);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method operates on.

modelName
String String

The name of the entry being validated.

validationMessage
String String

The message to display if the specified entry contains an error.

tag
String String

The tag to be set for the wrapping HTML element of the validation message.

Returns

null if the entry is valid and client-side validation is disabled. Otherwise, a tag element that contains an error message.

ValidationMessage(HtmlHelper, String, String, Object) ValidationMessage(HtmlHelper, String, String, Object)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage, object htmlAttributes);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string * obj -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

validationMessage
String String

The message to display if the specified field contains an error.

htmlAttributes
Object Object

An object that contains the HTML attributes for the element.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>) ValidationMessage(HtmlHelper, String, String, IDictionary<String,Object>)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

validationMessage
String String

The message to display if the specified field contains an error.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes for the element.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

ValidationMessage(HtmlHelper, String, Object, String) ValidationMessage(HtmlHelper, String, Object, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, object htmlAttributes, string tag);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * obj * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method operates on.

modelName
String String

The name of the entry being validated.

htmlAttributes
Object Object

An object that contains the HTML attributes for the element.

tag
String String

The tag to be set for the wrapping HTML element of the validation message.

Returns

null if the entry is valid and client-side validation is disabled. Otherwise, a tag element that contains an error message.

ValidationMessage(HtmlHelper, String, IDictionary<String,Object>, String) ValidationMessage(HtmlHelper, String, IDictionary<String,Object>, String)

Displays a validation message if an error exists for the specified entry in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, System.Collections.Generic.IDictionary<string,object> htmlAttributes, string tag);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * System.Collections.Generic.IDictionary<string, obj> * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method operates on.

modelName
String String

The name of the entry being validated.

htmlAttributes
IDictionary<String,Object>

An IDictionary<TKey,TValue> that contains the HTML attributes for the element.

tag
String String

The tag to be set for the wrapping HTML element of the validation message.

Returns

null if the entry is valid and client-side validation is disabled. Otherwise, a tag element that contains an error message.

ValidationMessage(HtmlHelper, String, String) ValidationMessage(HtmlHelper, String, String)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, string validationMessage);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

validationMessage
String String

The message to display if the specified field contains an error.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

ValidationMessage(HtmlHelper, String, Object) ValidationMessage(HtmlHelper, String, Object)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, object htmlAttributes);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * obj -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

htmlAttributes
Object Object

An object that contains the HTML attributes for the element.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

ValidationMessage(HtmlHelper, String, IDictionary<String,Object>) ValidationMessage(HtmlHelper, String, IDictionary<String,Object>)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

htmlAttributes
IDictionary<String,Object>

An object that contains the HTML attributes for the element.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

ValidationMessage(HtmlHelper, String) ValidationMessage(HtmlHelper, String)

Displays a validation message if an error exists for the specified field in the ModelStateDictionary object.

public static System.Web.Mvc.MvcHtmlString ValidationMessage (this System.Web.Mvc.HtmlHelper htmlHelper, string modelName);
static member ValidationMessage : System.Web.Mvc.HtmlHelper * string -> System.Web.Mvc.MvcHtmlString

Parameters

htmlHelper
HtmlHelper HtmlHelper

The HTML helper instance that this method extends.

modelName
String String

The name of the property or model object that is being validated.

Returns

If the property or object is valid, an empty string; otherwise, a span element that contains an error message.

Applies to