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.IHtmlHelper
instance this method extends.Return type: System.String Returns: A System.String
containing 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`1
ofSystem.Collections.Generic.IEnumerable`1
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>(this IHtmlHelper<IEnumerable<TModelItem>> htmlHelper, Expression<Func<TModelItem, TResult>> expression)
- htmlHelper (Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<System.Collections.Generic.IEnumerable<TModelItem>>) – The
-