HtmlHelper<TModel> Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A HtmlHelper for a specific model type.
generic <typename TModel>
public ref class HtmlHelper : Microsoft::AspNetCore::Mvc::ViewFeatures::HtmlHelper, Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper<TModel>
public class HtmlHelper<TModel> : Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper, Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>
type HtmlHelper<'Model> = class
inherit HtmlHelper
interface IHtmlHelper<'Model>
interface IHtmlHelper
type HtmlHelper<'Model> = class
inherit HtmlHelper
interface IHtmlHelper
interface IHtmlHelper<'Model>
Public Class HtmlHelper(Of TModel)
Inherits HtmlHelper
Implements IHtmlHelper(Of TModel)
- TModel
The model type.
- Inheritance
- Implements
Html |
Initializes a new instance of the HtmlHelper<TModel> class. |
Html |
Initializes a new instance of the HtmlHelper<TModel> class. |
Html5Date |
Set this property to CurrentCulture to have templated helpers such as Editor(String, String, String, Object) and EditorFor<TResult>(Expression<Func<TModel,TResult>>, String, String, Object) render date and time values using the current culture. By default, these helpers render dates and times as RFC 3339 compliant strings. (Inherited from HtmlHelper) |
Id |
Gets the String that replaces periods in the ID attribute of an element. (Inherited from HtmlHelper) |
Metadata |
Gets the metadata provider. Intended for use in IHtmlHelper extension methods. (Inherited from HtmlHelper) |
Temp |
Gets the current ITempDataDictionary instance. (Inherited from HtmlHelper) |
Url |
Gets the UrlEncoder to be used for encoding a URL. (Inherited from HtmlHelper) |
View |
Gets the view bag. (Inherited from HtmlHelper) |
View |
Gets the context information about the view. (Inherited from HtmlHelper) |
View |
Gets the current view data. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. (Inherited from HtmlHelper) |
Anti |
Returns a <hidden> element (antiforgery token) that will be validated when the containing <form> is submitted. (Inherited from HtmlHelper) |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. The route with name |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Contextualize(View |
Sets the ViewContext. |
Create |
Override this method to return an MvcForm subclass. That subclass may change EndForm() behavior. (Inherited from HtmlHelper) |
Display(String, String, String, Object) |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns the display name for the specified |
Display |
Returns the display name for the specified |
Display |
Returns the display name for the specified |
Display |
Returns the simple display text for the specified |
Display |
Returns the simple display text for the specified |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Editor(String, String, String, Object) |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Encode(Object) |
Converts the |
Encode(String) |
Converts the specified String to an HTML-encoded String. (Inherited from HtmlHelper) |
End |
Renders the </form> end tag to the response. (Inherited from HtmlHelper) |
Format |
Formats the value. (Inherited from HtmlHelper) |
Generate |
Generate a check box. (Inherited from HtmlHelper) |
Generate |
Generate a display. (Inherited from HtmlHelper) |
Generate |
Generate display name. (Inherited from HtmlHelper) |
Generate |
Generate display text. (Inherited from HtmlHelper) |
Generate |
Generate a drop down. (Inherited from HtmlHelper) |
Generate |
Generate editor. (Inherited from HtmlHelper) |
Generate |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Generate |
Generate a hidden. (Inherited from HtmlHelper) |
Generate |
Generate an id. (Inherited from HtmlHelper) |
Generate |
Returns an HTML element Id for the specified expression |
Generate |
Generate a label. (Inherited from HtmlHelper) |
Generate |
Generate a list box. (Inherited from HtmlHelper) |
Generate |
Geneate a name. (Inherited from HtmlHelper) |
Generate |
Generate a password. (Inherited from HtmlHelper) |
Generate |
Generate a radio button. (Inherited from HtmlHelper) |
Generate |
Renders a <form> start tag to the response. The route with name |
Generate |
Generate a text area. (Inherited from HtmlHelper) |
Generate |
Generates a text box. (Inherited from HtmlHelper) |
Generate |
Generate a validation message. (Inherited from HtmlHelper) |
Generate |
Generate a validation summary. (Inherited from HtmlHelper) |
Generate |
Generate a value. (Inherited from HtmlHelper) |
Get |
Returns a select list for the given |
Get |
Returns a select list for the given |
Get |
Returns a select list for the given |
Get |
Gets the name for |
Get |
Gets the ModelExplorer for |
Hidden(String, Object, Object) |
Returns an <input> element of type "hidden" for the specified |
Hidden |
Returns an <input> element of type "hidden" for the specified |
Id(String) |
Returns the HTML element Id for the specified |
Id |
Returns the HTML element Id for the specified |
Label(String, String, Object) |
Returns a <label> element for the specified |
Label |
Returns a <label> element for the specified |
List |
Returns a multi-selection <select> element for the |
List |
Returns a multi-selection <select> element for the |
Name(String) |
Returns the full HTML element name for the specified |
Name |
Returns the full HTML element name for the specified |
Partial |
Returns HTML markup for the specified partial view. (Inherited from HtmlHelper) |
Password(String, Object, Object) |
Returns an <input> element of type "password" for the specified |
Password |
Returns an <input> element of type "password" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Raw(Object) |
Wraps HTML markup from the string representation of an Object in an HtmlString, without HTML-encoding the string representation. (Inherited from HtmlHelper) |
Raw(String) |
Wraps HTML markup in an HtmlString, without HTML-encoding the specified
|
Render |
Renders HTML markup for the specified partial view. (Inherited from HtmlHelper) |
Render |
Render a partial view. (Inherited from HtmlHelper) |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. (Inherited from HtmlHelper) |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary object
for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. (Inherited from HtmlHelper) |
Value(String, String) |
Returns the formatted value for the specified |
Value |
Returns the formatted value for the specified |
Render |
Renders the specified |
Render |
Renders the |
Render |
Renders the |
Display(IHtml |
Returns HTML markup for the |
Display(IHtml |
Returns HTML markup for the |
Display(IHtml |
Returns HTML markup for the |
Display(IHtml |
Returns HTML markup for the |
Display(IHtml |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns HTML markup for the |
Display |
Returns HTML markup for the current model, using a display template and specified additional view data. The template is found using the model's ModelMetadata. |
Display |
Returns HTML markup for the current model, using a display template and specified additional view data. The
template is found using the |
Display |
Returns HTML markup for the current model, using a display template, specified HTML field name, and
additional view data. The template is found using the |
Display |
Returns HTML markup for the current model, using a display template and specified HTML field name. The
template is found using the |
Display |
Returns HTML markup for the current model, using a display template. The template is found using the
|
Display |
Returns HTML markup for the current model, using a display template. The template is found using the model's ModelMetadata. |
Display |
Returns the display name for the current model. |
Editor(IHtml |
Returns HTML markup for the |
Editor(IHtml |
Returns HTML markup for the |
Editor(IHtml |
Returns HTML markup for the |
Editor(IHtml |
Returns HTML markup for the |
Editor(IHtml |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Editor |
Returns HTML markup for the |
Editor |
Returns HTML markup for the current model, using an editor template and specified additional view data. The template is found using the model's ModelMetadata. |
Editor |
Returns HTML markup for the current model, using an editor template and specified additional view data. The
template is found using the |
Editor |
Returns HTML markup for the current model, using an editor template, specified HTML field name, and
additional view data. The template is found using the |
Editor |
Returns HTML markup for the current model, using an editor template and specified HTML field name. The
template is found using the |
Editor |
Returns HTML markup for the current model, using an editor template. The template is found using the
|
Editor |
Returns HTML markup for the current model, using an editor template. The template is found using the model's ModelMetadata. |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the current action will process the request. |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the current action will process the request. |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the current action will process the request. |
Begin |
Renders a <form> start tag to the response. The <form>'s |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the current action will process the request. |
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. When the user submits the form, the action with name
|
Begin |
Renders a <form> start tag to the response. The <form>'s |
Begin |
Renders a <form> start tag to the response. The first route that can provide a URL with the
specified |
Begin |
Renders a <form> start tag to the response. The first route that can provide a URL with the
specified |
Begin |
Renders a <form> start tag to the response. The route with name |
Begin |
Renders a <form> start tag to the response. The route with name |
Begin |
Renders a <form> start tag to the response. The route with name |
Begin |
Renders a <form> start tag to the response. The route with name |
Begin |
Renders a <form> start tag to the response. The route with name |
Begin |
Renders a <form> start tag to the response. The route with name |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Check |
Returns an <input> element of type "checkbox" with value "true" and an <input> element of type
"hidden" with value "false" for the specified |
Hidden(IHtml |
Returns an <input> element of type "hidden" for the specified |
Hidden(IHtml |
Returns an <input> element of type "hidden" for the specified |
Hidden |
Returns an <input> element of type "hidden" for the specified |
Password(IHtml |
Returns an <input> element of type "password" for the specified |
Password(IHtml |
Returns an <input> element of type "password" for the specified |
Password |
Returns an <input> element of type "password" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Radio |
Returns an <input> element of type "radio" for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns a <textarea> element for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Text |
Returns an <input> element of type "text" for the specified |
Label(IHtml |
Returns a <label> element for the specified |
Label(IHtml |
Returns a <label> element for the specified |
Label |
Returns a <label> element for the specified |
Label |
Returns a <label> element for the specified |
Label |
Returns a <label> element for the specified |
Label |
Returns a <label> element for the current model. |
Label |
Returns a <label> element for the current model. |
Label |
Returns a <label> element for the current model. |
Label |
Returns a <label> element for the current model. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Action |
Returns an anchor (<a>) element that contains a URL path to the specified action. |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. |
Route |
Returns an anchor (<a>) element that contains a URL path to the specified route. |
Id |
Returns the HTML element Id for the current model. |
Name |
Returns the full HTML element name for the current model. Uses HtmlFieldPrefix (if non-empty) to reflect relationship between current Model and the top-level view's model. |
Partial(IHtml |
Returns HTML markup for the specified partial view. |
Partial(IHtml |
Returns HTML markup for the specified partial view. |
Partial(IHtml |
Returns HTML markup for the specified partial view. |
Partial(IHtml |
Returns HTML markup for the specified partial view. |
Partial |
Returns HTML markup for the specified partial view. |
Partial |
Returns HTML markup for the specified partial view. |
Partial |
Returns HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Render |
Renders HTML markup for the specified partial view. |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
Drop |
Returns a single-selection HTML <select> element for the |
List |
Returns a multi-selection <select> element for the |
List |
Returns a multi-selection <select> element for the |
List |
Returns a multi-selection <select> element for the |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns the validation message if an error exists in the ModelStateDictionary
object for the specified |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Validation |
Returns an unordered list (<ul> element) of validation messages that are in the ModelStateDictionary object. |
Value(IHtml |
Returns the formatted value for the specified |
Value |
Returns the formatted value for the specified |
Value |
Returns the formatted value for the current model. Specifically, returns the
first non- |
Value |
Returns the formatted value for the current model. Specifically, returns the
first non- |
Product | Versions |
---|---|
ASP.NET Core | 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |