HtmlHelperEditorExtensions.EditorForModel HtmlHelperEditorExtensions.EditorForModel HtmlHelperEditorExtensions.EditorForModel Method

Definition

Overloads

EditorForModel(IHtmlHelper) EditorForModel(IHtmlHelper) EditorForModel(IHtmlHelper)

Returns HTML markup for the current model, using an editor template. The template is found using the model's ModelMetadata.

EditorForModel(IHtmlHelper, Object) EditorForModel(IHtmlHelper, Object) EditorForModel(IHtmlHelper, Object)

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.

EditorForModel(IHtmlHelper, String) EditorForModel(IHtmlHelper, String) EditorForModel(IHtmlHelper, String)

Returns HTML markup for the current model, using an editor template. The template is found using the templateName or the model's ModelMetadata.

EditorForModel(IHtmlHelper, String, Object) EditorForModel(IHtmlHelper, String, Object) EditorForModel(IHtmlHelper, String, Object)

Returns HTML markup for the current model, using an editor template and specified additional view data. The template is found using the templateName or the model's ModelMetadata.

EditorForModel(IHtmlHelper, String, String) EditorForModel(IHtmlHelper, String, String) EditorForModel(IHtmlHelper, String, String)

Returns HTML markup for the current model, using an editor template and specified HTML field name. The template is found using the templateName or the model's ModelMetadata.

EditorForModel(IHtmlHelper, String, String, Object) EditorForModel(IHtmlHelper, String, String, Object) EditorForModel(IHtmlHelper, String, String, Object)

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 templateName or the model's ModelMetadata.

EditorForModel(IHtmlHelper) EditorForModel(IHtmlHelper) EditorForModel(IHtmlHelper)

Returns HTML markup for the current model, using an editor template. The template is found using the model's ModelMetadata.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

EditorForModel(IHtmlHelper, Object) EditorForModel(IHtmlHelper, Object) EditorForModel(IHtmlHelper, Object)

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.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, object additionalViewData);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper, additionalViewData As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

additionalViewData
Object Object Object

An anonymous Object or IDictionary<TKey,TValue> that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance created for the template.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

EditorForModel(IHtmlHelper, String) EditorForModel(IHtmlHelper, String) EditorForModel(IHtmlHelper, String)

Returns HTML markup for the current model, using an editor template. The template is found using the templateName or the model's ModelMetadata.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string templateName);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper, templateName As String) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

templateName
String String String

The name of the template used to create the HTML markup.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

EditorForModel(IHtmlHelper, String, Object) EditorForModel(IHtmlHelper, String, Object) EditorForModel(IHtmlHelper, String, Object)

Returns HTML markup for the current model, using an editor template and specified additional view data. The template is found using the templateName or the model's ModelMetadata.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string templateName, object additionalViewData);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper, templateName As String, additionalViewData As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

templateName
String String String

The name of the template used to create the HTML markup.

additionalViewData
Object Object Object

An anonymous Object or IDictionary<TKey,TValue> that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance created for the template.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

EditorForModel(IHtmlHelper, String, String) EditorForModel(IHtmlHelper, String, String) EditorForModel(IHtmlHelper, String, String)

Returns HTML markup for the current model, using an editor template and specified HTML field name. The template is found using the templateName or the model's ModelMetadata.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string templateName, string htmlFieldName);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper, templateName As String, htmlFieldName As String) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

templateName
String String String

The name of the template used to create the HTML markup.

htmlFieldName
String String String

A String used to disambiguate the names of HTML elements that are created for properties that have the same name.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

EditorForModel(IHtmlHelper, String, String, Object) EditorForModel(IHtmlHelper, String, String, Object) EditorForModel(IHtmlHelper, String, String, Object)

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 templateName or the model's ModelMetadata.

public static Microsoft.AspNetCore.Html.IHtmlContent EditorForModel (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string templateName, string htmlFieldName, object additionalViewData);
static member EditorForModel : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function EditorForModel (htmlHelper As IHtmlHelper, templateName As String, htmlFieldName As String, additionalViewData As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

templateName
String String String

The name of the template used to create the HTML markup.

htmlFieldName
String String String

A String used to disambiguate the names of HTML elements that are created for properties that have the same name.

additionalViewData
Object Object Object

An anonymous Object or IDictionary<TKey,TValue> that can contain additional view data that will be merged into the ViewDataDictionary<TModel> instance created for the template.

Returns

A new IHtmlContent containing the <input> element(s).

Remarks

For example the default Object editor template includes <label> and <input> elements for each property in the current model.

Custom templates are found under a EditorTemplates folder. The folder name is case-sensitive on case-sensitive file systems.

Applies to