ValueExtensions.ValueFor 方法

定義

多載

ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)

提供用來建立與 ASP.NET MVC 模型繫結器和範本相容之自訂 HTML 標記的機制。

ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)

提供用來建立與 ASP.NET MVC 模型繫結器和範本相容之自訂 HTML 標記的機制。

ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)

提供用來建立與 ASP.NET MVC 模型繫結器和範本相容之自訂 HTML 標記的機制。

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

類型參數

TModel

模型本身。

TProperty

屬性。

參數

html
HtmlHelper<TModel>

此方法擴充的 HTML Helper 執行個體。

expression
Expression<Func<TModel,TProperty>>

運算式,可識別包含要公開之屬性的物件。

傳回

此值的 HTML 標記。

適用於

ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)

提供用來建立與 ASP.NET MVC 模型繫結器和範本相容之自訂 HTML 標記的機制。

public static System.Web.Mvc.MvcHtmlString ValueFor<TModel,TProperty> (this System.Web.Mvc.HtmlHelper<TModel> html, System.Linq.Expressions.Expression<Func<TModel,TProperty>> expression, string format);
static member ValueFor : System.Web.Mvc.HtmlHelper<'Model> * System.Linq.Expressions.Expression<Func<'Model, 'Property>> * string -> System.Web.Mvc.MvcHtmlString
<Extension()>
Public Function ValueFor(Of TModel, TProperty) (html As HtmlHelper(Of TModel), expression As Expression(Of Func(Of TModel, TProperty)), format As String) As MvcHtmlString

類型參數

TModel

模型本身。

TProperty

屬性。

參數

html
HtmlHelper<TModel>

此方法擴充的 HTML Helper 執行個體。

expression
Expression<Func<TModel,TProperty>>

運算式,可識別包含要公開之屬性的物件。

format
String

格式字串。

傳回

此值的 HTML 標記。

適用於