HtmlHelperDisplayNameExtensions Class¶
DisplayName-related extensions for Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper and Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper`1.
- Namespace
Microsoft.AspNetCore.Mvc.Rendering- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class HtmlHelperDisplayNameExtensions
-
class
Microsoft.AspNetCore.Mvc.Rendering.HtmlHelperDisplayNameExtensions
Methods¶
-
DisplayNameForModel(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper)¶ Returns the display name for the current model.
Arguments: htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper) – The Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelperinstance this method extends.Return type: System.String Returns: A System.Stringcontaining the display name.public static string DisplayNameForModel(this IHtmlHelper htmlHelper)
-
DisplayNameFor<TModelItem, TResult>(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>>, System.Linq.Expressions.Expression<System.Func<TModelItem, TResult>>)¶ Returns the display name for the specified <em>expression</em> if the current model represents a collection.
Arguments: - htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>>) – The
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper`1ofSystem.Collections.Generic.IEnumerable`1instance 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.Stringcontaining the display name.public static string DisplayNameFor<TModelItem, TResult>(this IHtmlHelper<IEnumerable<TModelItem>> htmlHelper, Expression<Func<TModelItem, TResult>> expression)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>>) – The
-