HtmlHelperEditorExtensions.Editor Method

Definition

Overloads

Editor(IHtmlHelper, String)

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

Editor(IHtmlHelper, String, Object)

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

Editor(IHtmlHelper, String, String)

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

Editor(IHtmlHelper, String, String, Object)

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

Editor(IHtmlHelper, String, String, String)

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

Editor(IHtmlHelper, String)

Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs

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

C#
public static Microsoft.AspNetCore.Html.IHtmlContent Editor (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model. May identify a single property or an Object that contains the properties to edit.

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 expression's value.

Example expressions include string.Empty which identifies the current model and "prop" which identifies the current model's "prop" property.

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

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
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

Editor(IHtmlHelper, String, Object)

Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs

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

C#
public static Microsoft.AspNetCore.Html.IHtmlContent Editor (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object additionalViewData);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model. May identify a single property or an Object that contains the properties to edit.

additionalViewData
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 expression's value.

Example expressions include string.Empty which identifies the current model and "prop" which identifies the current model's "prop" property.

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

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
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

Editor(IHtmlHelper, String, String)

Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs

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

C#
public static Microsoft.AspNetCore.Html.IHtmlContent Editor (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, string templateName);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model. May identify a single property or an Object that contains the properties to edit.

templateName
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 expression's value.

Example expressions include string.Empty which identifies the current model and "prop" which identifies the current model's "prop" property.

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

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
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

Editor(IHtmlHelper, String, String, Object)

Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs

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

C#
public static Microsoft.AspNetCore.Html.IHtmlContent Editor (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, string templateName, object additionalViewData);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model. May identify a single property or an Object that contains the properties to edit.

templateName
String

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

additionalViewData
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 expression's value.

Example expressions include string.Empty which identifies the current model and "prop" which identifies the current model's "prop" property.

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

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
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

Editor(IHtmlHelper, String, String, String)

Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs
Source:
HtmlHelperEditorExtensions.cs

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

C#
public static Microsoft.AspNetCore.Html.IHtmlContent Editor (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, string templateName, string htmlFieldName);

Parameters

htmlHelper
IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model. May identify a single property or an Object that contains the properties to edit.

templateName
String

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

htmlFieldName
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 expression's value.

Example expressions include string.Empty which identifies the current model and "prop" which identifies the current model's "prop" property.

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

Applies to

ASP.NET Core 9.0 ja muut versiot
Tuote Versiot
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