Class NameExtensions
Gets the HTML ID and name attributes of the HtmlHelper string.
public static class NameExtensions
- Inheritance
-
NameExtensions
- Inherited Members
Methods
Id(HtmlHelper, string)
Gets the ID of the HtmlHelper string.
public static MvcHtmlString Id(this HtmlHelper html, string name)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
namestringAn expression that identifies the object that contains the ID.
Returns
- MvcHtmlString
The HTML ID attribute value for the object that is represented by the expression.
IdForModel(HtmlHelper)
Gets the ID of the HtmlHelper string.
public static MvcHtmlString IdForModel(this HtmlHelper html)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
Returns
- MvcHtmlString
The HTML ID attribute value for the object that is represented by the expression.
IdFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)
Gets the ID of the HtmlHelper<TModel> string
public static MvcHtmlString IdFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TProperty>>An expression that identifies the object that contains the ID.
Returns
- MvcHtmlString
The HTML ID attribute value for the object that is represented by the expression.
Type Parameters
TModelThe type of the model.
TPropertyThe type of the property.
Name(HtmlHelper, string)
Gets the full HTML field name for the object that is represented by the expression.
public static MvcHtmlString Name(this HtmlHelper html, string name)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
namestringAn expression that identifies the object that contains the name.
Returns
- MvcHtmlString
The full HTML field name for the object that is represented by the expression.
NameForModel(HtmlHelper)
Gets the full HTML field name for the object that is represented by the expression.
public static MvcHtmlString NameForModel(this HtmlHelper html)
Parameters
htmlHtmlHelperThe HTML helper instance that this method extends.
Returns
- MvcHtmlString
The full HTML field name for the object that is represented by the expression.
NameFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>)
Gets the full HTML field name for the object that is represented by the expression.
public static MvcHtmlString NameFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression)
Parameters
htmlHtmlHelper<TModel>The HTML helper instance that this method extends.
expressionExpression<Func<TModel, TProperty>>An expression that identifies the object that contains the name.
Returns
- MvcHtmlString
The full HTML field name for the object that is represented by the expression.
Type Parameters
TModelThe type of the model.
TPropertyThe type of the property.