HtmlHelperEditorExtensions Class

Summary

Editor-related extensions for [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) and [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml).

Syntax

public class HtmlHelperEditorExtensions

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions

Methods

Editor(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)

Returns HTML markup for the <paramref name=”expression” />, using an editor template. The template is found using the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • expression (System.String) – Expression name, relative to the current model. May identify a single property or an [System.Object]() that contains the properties to edit.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString Editor(IHtmlHelper htmlHelper, string expression)
Editor(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified additional view data. The template is found using the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • expression (System.String) – Expression name, relative to the current model. May identify a single property or an [System.Object]() that contains the properties to edit.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString Editor(IHtmlHelper htmlHelper, string expression, object additionalViewData)
Editor(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.String)

Returns HTML markup for the <paramref name=”expression” />, using an editor template. The template is found using the <paramref name=”templateName” /> or the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • expression (System.String) – Expression name, relative to the current model. May identify a single property or an [System.Object]() that contains the properties to edit.
  • templateName (System.String) – The name of the template used to create the HTML markup.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString Editor(IHtmlHelper htmlHelper, string expression, string templateName)
Editor(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.String, System.Object)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified additional view data. The template is found using the <paramref name=”templateName” /> or the

<paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • expression (System.String) – Expression name, relative to the current model. May identify a single property or an [System.Object]() that contains the properties to edit.
  • templateName (System.String) – The name of the template used to create the HTML markup.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString Editor(IHtmlHelper htmlHelper, string expression, string templateName, object additionalViewData)
Editor(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.String, System.String)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified HTML field name. The template is found using the <paramref name=”templateName” /> or the

<paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • expression (System.String) – Expression name, relative to the current model. May identify a single property or an [System.Object]() that contains the properties to edit.
  • templateName (System.String) – The name of the template used to create the HTML markup.
  • htmlFieldName (System.String) – A [System.String]() used to disambiguate the names of HTML elements that are created for properties that have the same name.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString Editor(IHtmlHelper htmlHelper, string expression, string templateName, string htmlFieldName)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper)

Returns HTML markup for the current model, using an editor template. The template is found using the model’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.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 [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper, object additionalViewData)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String)

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

<paramref name=”templateName” /> or the model’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • templateName (System.String) – The name of the template used to create the HTML markup.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper, string templateName)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.Object)

Returns HTML markup for the current model, using an editor template and specified additional view data. The template is found using the <paramref name=”templateName” /> or the model’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • templateName (System.String) – The name of the template used to create the HTML markup.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper, string templateName, object additionalViewData)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.String)

Returns HTML markup for the current model, using an editor template and specified HTML field name. The template is found using the <paramref name=”templateName” /> or the model’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • templateName (System.String) – The name of the template used to create the HTML markup.
  • htmlFieldName (System.String) – A [System.String]() used to disambiguate the names of HTML elements that are created for properties that have the same name.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper, string templateName, string htmlFieldName)
EditorForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper, System.String, System.String, System.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 <paramref name=”templateName” /> or the model’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
  • templateName (System.String) – The name of the template used to create the HTML markup.
  • htmlFieldName (System.String) – A [System.String]() used to disambiguate the names of HTML elements that are created for properties that have the same name.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorForModel(IHtmlHelper htmlHelper, string templateName, string htmlFieldName, object additionalViewData)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions.EditorFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>)

Returns HTML markup for the <paramref name=”expression” />, using an editor template. The template is found using the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
  • expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions.EditorFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>, System.Object)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified additional view data. The template is found using the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
  • expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression, object additionalViewData)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions.EditorFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>, System.String)

Returns HTML markup for the <paramref name=”expression” />, using an editor template. The template is found using the <paramref name=”templateName” /> or the <paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
  • expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
  • templateName (System.String) – The name of the template that is used to create the HTML markup.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression, string templateName)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions.EditorFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>, System.String, System.Object)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified additional view data. The template is found using the <paramref name=”templateName” /> or the

<paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
  • expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
  • templateName (System.String) – The name of the template that is used to create the HTML markup.
  • additionalViewData (System.Object) – An anonymous [System.Object]() or [System.Collections.Generic.IDictionary`2]() that can contain additional view data that will be merged into the [Microsoft.AspNet.Mvc.ViewDataDictionary`1](Microsoft.AspNet.Mvc.ViewDataDictionary`1.yml) instance created for the template.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression, string templateName, object additionalViewData)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperEditorExtensions.EditorFor<TModel, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel, TResult>>, System.String, System.String)

Returns HTML markup for the <paramref name=”expression” />, using an editor template and specified HTML field name. The template is found using the <paramref name=”templateName” /> or the

<paramref name=”expression” />’s [Microsoft.AspNet.Mvc.ModelBinding.ModelMetadata]().

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{{TModel}}) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper`1.yml) instance this method extends.
  • expression (System.Linq.Expressions.Expression{System.Func{{TModel},{TResult}}}) – An expression to be evaluated against the current model.
  • templateName (System.String) – The name of the template that is used to create the HTML markup.
  • htmlFieldName (System.String) – A [System.String]() used to disambiguate the names of HTML elements that are created for properties that have the same name.
Return type:

Microsoft.AspNet.Mvc.Rendering.HtmlString

Returns:

A new [Microsoft.AspNet.Mvc.Rendering.HtmlString](Microsoft.AspNet.Mvc.Rendering.HtmlString.yml) containing the &lt;input&gt; element(s).

public static HtmlString EditorFor<TModel, TResult>(IHtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TResult>> expression, string templateName, string htmlFieldName)