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).
Methods¶
-
DisplayNameForModel
(Microsoft.AspNet.Mvc.Rendering.IHtmlHelper)¶ Returns the display name for the current model.
Arguments: - htmlHelper (Microsoft.AspNet.Mvc.Rendering.IHtmlHelper) – The [Microsoft.AspNet.Mvc.Rendering.IHtmlHelper](Microsoft.AspNet.Mvc.Rendering.IHtmlHelper.yml) instance this method extends.
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)
-