HtmlHelperDisplayNameExtensions Class

Summary

DisplayName-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 HtmlHelperDisplayNameExtensions

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Rendering.HtmlHelperDisplayNameExtensions

Methods

DisplayNameForModel(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper)

Returns the display name for the current model.

Arguments:
Return type:

System.String

Returns:

A [System.String]() containing the display name.

public static string DisplayNameForModel(IHtmlHelper htmlHelper)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperDisplayNameExtensions.DisplayNameFor<TModelItem, TResult>(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>>, System.Linq.Expressions.Expression<System.Func<TModelItem, TResult>>)

Returns the display name for the specified <paramref name=”expression” /> if the current model represents a collection.

Arguments:
  • htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper{System.Collections.Generic.IEnumerable{{TModelItem}}}) – 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{{TModelItem},{TResult}}}) – An expression to be evaluated against an item in the current model.
Return type:

System.String

Returns:

A [System.String]() containing the display name.

public static string DisplayNameFor<TModelItem, TResult>(IHtmlHelper<IEnumerable<TModelItem>> htmlHelper, Expression<Func<TModelItem, TResult>> expression)