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
html
HtmlHelperThe HTML helper instance that this method extends.
name
stringAn 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
html
HtmlHelperThe 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
html
HtmlHelper<TModel>The HTML helper instance that this method extends.
expression
Expression<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
TModel
The type of the model.
TProperty
The 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
html
HtmlHelperThe HTML helper instance that this method extends.
name
stringAn 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
html
HtmlHelperThe 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
html
HtmlHelper<TModel>The HTML helper instance that this method extends.
expression
Expression<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
TModel
The type of the model.
TProperty
The type of the property.