This topic has not yet been rated - Rate this topic

ValidationMessageFor(TModel, TProperty) Method (HtmlHelper(TModel), Expression(Func), Boolean, TModel)

Namespace:  System.Web.Mvc.Html
Assemblies:   System.Web.Mvc (in System.Web.Mvc.dll)
  System.Web.Mvc (in System.Web.Mvc.dll)
public static MvcHtmlString ValidationMessageFor<TModel, TProperty>(
	this HtmlHelper<TModel> htmlHelper,
	Expression<Func> expression,
	bool validationMessage,
	TModel htmlAttributes
)

Type Parameters

TModel
TProperty

Parameters

htmlHelper
Type: System.Web.Mvc..::..HtmlHelper<(Of <(<'TModel>)>)>
expression
Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'T, TResult>)>)>>)>)>
validationMessage
Type: System..::..Boolean
htmlAttributes
Type: TModel

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper<(Of <(<'TModel>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see b8020aae-374d-46a9-bcb7-8cc2390b93b6 or 175ce3ff-9bbf-4e64-8421-faeb81a0bb51.
Did you find this helpful?
(1500 characters remaining)