Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static System.Web.Mvc.MvcHtmlString LabelFor (this System.Web.Mvc.HtmlHelper html, System.Linq.Expressions.Expression> expression, string labelText, System.Collections.Generic.IDictionary htmlAttributes);
static member LabelFor : System.Web.Mvc.HtmlHelper * System.Linq.Expressions.Expression> * string * System.Collections.Generic.IDictionary -> System.Web.Mvc.MvcHtmlString
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), labelText As String, htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString
Type Parameters
TModel
The type of the model.
TValue
The type of the value.
Parameters
The HTML helper instance that this method extends.
expression
Expression>
An expression that identifies the property to display.
labelText
The label text to display.
An object that contains the HTML attributes to set for the element.
Returns
An HTML label element and the property name of the property that is represented by the expression.
Applies to