ValidationExtensions.ValidationMessageFor ValidationExtensions.ValidationMessageFor ValidationExtensions.ValidationMessageFor Method

Definition

Overloads

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String)

Returns the HTML markup for a validation-error message for the specified expression.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String)

Returns the HTML markup for a validation-error message for the specified expression.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String)

Returns the HTML markup for a validation-error message for the specified expression.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object, String)

Returns the HTML markup for a validation-error message for the specified expression.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage, object htmlAttributes, string tag);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * obj * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String, htmlAttributes As Object, tag As String) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method operates on.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String String String

The message to display if a validation error occurs.

htmlAttributes
Object Object Object

An object that contains the HTML attributes for the element.

tag
String 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>, String)

Returns the HTML markup for a validation-error message for the specified expression.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage, System.Collections.Generic.IDictionary<string,object> htmlAttributes, string tag);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * System.Collections.Generic.IDictionary<string, obj> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String, htmlAttributes As IDictionary(Of String, Object), tag As String) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method operates on.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String String String

The message to display if a validation error occurs.

htmlAttributes
IDictionary<String,Object>

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

tag
String 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, String)

Returns the HTML markup for a validation-error message for the specified expression.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage, string tag);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String, tag As String) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method operates on.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String String String

The message to display if a validation error occurs.

tag
String 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, Object)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage, object htmlAttributes);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String, htmlAttributes As Object) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String String String

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

htmlAttributes
Object 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String, IDictionary<String,Object>)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string validationMessage);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), validationMessage As String) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

validationMessage
String 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.

ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>) ValidationMessageFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)

Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression.

public static System.Web.Mvc.MvcHtmlString ValidationMessageFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> htmlHelper, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression);
static member ValidationMessageFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValidationMessageFor(Of TModel, TProperty) (htmlHelper As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty))) As MvcHtmlString
Type Parameters
TModel

The type of the model.

TProperty

The type of the property.

Parameters
htmlHelper
HtmlHelper<TModel> HtmlHelper<TModel> HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TProperty>>

An expression that identifies the object that contains the properties to render.

Returns

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

Applies to