ValueExtensions.ValueFor Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>) |
Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. |
ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String) |
Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates. |
ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>)
Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
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
Type Parameters
- TModel
The model.
- TProperty
The property.
Parameters
- html
- HtmlHelper<TModel>
The HTML helper instance that this method extends.
- expression
- Expression<Func<TModel,TProperty>>
An expression that identifies the object that contains the properties to expose.
Returns
The HTML markup for the value.
Applies to
ValueFor<TModel,TProperty>(HtmlHelper<TModel>, Expression<Func<TModel,TProperty>>, String)
Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
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
Type Parameters
- TModel
The model.
- TProperty
The property.
Parameters
- html
- HtmlHelper<TModel>
The HTML helper instance that this method extends.
- expression
- Expression<Func<TModel,TProperty>>
An expression that identifies the object that contains the properties to expose.
- format
- String
The format string.
Returns
The HTML markup for the value.