Class LabelExtensions
Represents support for the HTML label element in an ASP.NET MVC view.
public static class LabelExtensions
- Inheritance
-
LabelExtensions
- Inherited Members
Methods
Label(HtmlHelper, string)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString Label(this HtmlHelper html, string expression)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Label(HtmlHelper, 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 MvcHtmlString Label(this HtmlHelper html, string expression, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Label(HtmlHelper, string, object)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString Label(this HtmlHelper html, string expression, object htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Label(HtmlHelper, string, 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 MvcHtmlString Label(this HtmlHelper html, string expression, string labelText)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
labelTextstringThe label text to display.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Label(HtmlHelper, string, 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 MvcHtmlString Label(this HtmlHelper html, string expression, string labelText, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
labelTextstringThe label text.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Label(HtmlHelper, string, string, object)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString Label(this HtmlHelper html, string expression, string labelText, object htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
expressionstringAn expression that identifies the property to display.
labelTextstringThe label text.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
LabelForModel(HtmlHelper)
Returns an HTML label element and the property name of the property that is represented by the model.
public static MvcHtmlString LabelForModel(this HtmlHelper html)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the model.
LabelForModel(HtmlHelper, IDictionary<string, object>)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString LabelForModel(this HtmlHelper html, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
LabelForModel(HtmlHelper, object)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString LabelForModel(this HtmlHelper html, object htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
LabelForModel(HtmlHelper, 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 MvcHtmlString LabelForModel(this HtmlHelper html, string labelText)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
labelTextstringThe label text to display.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
LabelForModel(HtmlHelper, 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 MvcHtmlString LabelForModel(this HtmlHelper html, string labelText, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
labelTextstringThe label Text.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
LabelForModel(HtmlHelper, string, object)
Returns an HTML label element and the property name of the property that is represented by the specified expression.
public static MvcHtmlString LabelForModel(this HtmlHelper html, string labelText, object htmlAttributes)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
labelTextstringThe label text.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the 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.
public static MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe type of the value.
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 MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe type of the value.
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 MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, object htmlAttributes)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe value.
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 MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string labelText)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
labelTextstringThe label text to display.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe type of the value.
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 MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string labelText, IDictionary<string, object> htmlAttributes)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
labelTextstringThe label text to display.
htmlAttributesIDictionary<string, object>An object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe type of the value.
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 MvcHtmlString LabelFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, string labelText, object htmlAttributes)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TValue>>An expression that identifies the property to display.
labelTextstringThe label text.
htmlAttributesobjectAn object that contains the HTML attributes to set for the element.
Returns
- MvcHtmlString
An HTML label element and the property name of the property that is represented by the expression.
Type Parameters
TModelThe type of the model.
TValueThe Value.