DisplayNameExtensions.DisplayNameFor 方法

定义

重载

DisplayNameFor<TModel,TValue>(HtmlHelper<IEnumerable<TModel>>, Expression<Func<TModel,TValue>>)

获取模型的显示名称。

DisplayNameFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>)

获取模型的显示名称。

DisplayNameFor<TModel,TValue>(HtmlHelper<IEnumerable<TModel>>, Expression<Func<TModel,TValue>>)

获取模型的显示名称。

public static System.Web.Mvc.MvcHtmlString DisplayNameFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<System.Collections.Generic.IEnumerable<TModel>> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression);
static member DisplayNameFor : System.Web.Mvc.HtmlHelper<seq<'Model>> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayNameFor(Of TModel, TValue) (html As HtmlHelper(Of IEnumerable(Of TModel)), expression As Expression(Of Func(Of TModel, TValue))) As MvcHtmlString

类型参数

TModel

模型的类型。

TValue

值的类型。

参数

html
HtmlHelper<IEnumerable<TModel>>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TValue>>

一个表达式,用于标识包含该显示名称的对象。

返回

模型的显示名称。

适用于

DisplayNameFor<TModel,TValue>(HtmlHelper<TModel>, Expression<Func<TModel,TValue>>)

获取模型的显示名称。

public static System.Web.Mvc.MvcHtmlString DisplayNameFor<TModel,TValue> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TValue>> expression);
static member DisplayNameFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Value>> -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function DisplayNameFor(Of TModel, TValue) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TValue))) As MvcHtmlString

类型参数

TModel

模型的类型。

TValue

值的类型。

参数

html
HtmlHelper<TModel>

此方法扩展的 HTML 帮助器实例。

expression
Expression<Func<TModel,TValue>>

一个表达式,用于标识包含该显示名称的对象。

返回

模型的显示名称。

适用于