IHtmlHelper<TModel>.LabelFor(Expression<Func<TModel,TResult>>, String, Object) IHtmlHelper<TModel>.LabelFor(Expression<Func<TModel,TResult>>, String, Object) IHtmlHelper<TModel>.LabelFor(Expression<Func<TModel,TResult>>, String, Object) Method

Definition

Returns a <label> element for the specified expression.

public Microsoft.AspNetCore.Html.IHtmlContent LabelFor<TResult> (System.Linq.Expressions.Expression<Func<TModel,TResult>> expression, string labelText, object htmlAttributes);
abstract member LabelFor : System.Linq.Expressions.Expression<Func<'Model, 'Result>> * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function LabelFor(Of TResult) (expression As Expression(Of Func(Of TModel, TResult)), labelText As String, htmlAttributes As Object) As IHtmlContent

Type Parameters

TResult

The type of the expression result.

Parameters

expression
Expression<Func<TModel,TResult>>

An expression to be evaluated against the current model.

labelText
String String String

The inner text of the element.

htmlAttributes
Object Object Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

Returns

A new IHtmlContent containing the <label> element.

Applies to