LabelExtensions.LabelFor Method

Definition

Overloads

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String, Object)

Returns an HTML label element and the property name of the property that is represented by the specified expression.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String, IDictionary<String,Object>)

Returns an HTML label element and the property name of the property that is represented by the specified expression.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String)

Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, Object)

Returns an HTML label element and the property name of the property that is represented by the specified expression.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, IDictionary<String,Object>)

Returns an HTML label element and the property name of the property that is represented by the specified expression.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>)

Returns an HTML label element and the property name of the property that is represented by the specified expression.

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String, Object)

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<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string labelText, object htmlAttributes);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), labelText As String, htmlAttributes As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The Value.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

labelText
String

The label text.

htmlAttributes
Object

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

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String, IDictionary<String,Object>)

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<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string labelText, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
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

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

labelText
String

The label text to display.

htmlAttributes
IDictionary<String,Object>

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

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, String)

Returns an HTML label element and the property name of the property that is represented by the specified expression using the label text.

public static System.Web.Mvc.MvcHtmlString LabelFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, string labelText);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), labelText As String) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

labelText
String

The label text to display.

Returns

An HTML label element and the property name of the property that is represented by the expression.

Applies to

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, Object)

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<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, object htmlAttributes);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * obj -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), htmlAttributes As Object) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The value.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

htmlAttributes
Object

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

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>, IDictionary<String,Object>)

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<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression, System.Collections.Generic.IDictionary<string,object> htmlAttributes);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> * System.Collections.Generic.IDictionary<string, obj> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue)), htmlAttributes As IDictionary(Of String, Object)) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

htmlAttributes
IDictionary<String,Object>

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

LabelFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>)

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<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression);
static member LabelFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function LabelFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue))) As MvcHtmlString

Type Parameters

TModel

The type of the model.

TValue

The type of the value.

Parameters

html
HtmlHelper<TModel>

The HTML helper instance that this method extends.

expression
Expression<Func<TModel,TValue>>

An expression that identifies the property to display.

Returns

An HTML label element and the property name of the property that is represented by the expression.

Applies to