ValueExtensions.ValueFor Method

 

Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

Namespace:   System.Web.Mvc.Html
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticValueFor(Of TModel, TProperty)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)))

Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

System_CAPS_pubmethodSystem_CAPS_staticValueFor(Of TModel, TProperty)(HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), String)

Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

Return to top

ValueExtensions.ValueFor(Of TModel, TProperty) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)))

Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

<ExtensionAttribute>
Public Shared Function ValueFor(Of TModel, TProperty) (
	html As HtmlHelper(Of TModel),
	expression As Expression(Of Func(Of TModel, TProperty))
) As MvcHtmlString

Parameters

html
Type: System.Web.Mvc.HtmlHelper(Of TModel)

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TModelTProperty))

An expression that identifies the object that contains the properties to expose.

Return Value

Type: System.Web.Mvc.MvcHtmlString

The HTML markup for the value.

Type Parameters

TModel

The model.

TProperty

The property.

Return to top

ValueExtensions.ValueFor(Of TModel, TProperty) Method (HtmlHelper(Of TModel), Expression(Of Func(Of TModel, TProperty)), String)

Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

<ExtensionAttribute>
Public Shared Function ValueFor(Of TModel, TProperty) (
	html As HtmlHelper(Of TModel),
	expression As Expression(Of Func(Of TModel, TProperty)),
	format As String
) As MvcHtmlString

Parameters

html
Type: System.Web.Mvc.HtmlHelper(Of TModel)

The HTML helper instance that this method extends.

expression
Type: System.Linq.Expressions.Expression(Of Func(Of TModelTProperty))

An expression that identifies the object that contains the properties to expose.

format
Type: System.String

The format string.

Return Value

Type: System.Web.Mvc.MvcHtmlString

The HTML markup for the value.

Type Parameters

TModel

The model.

TProperty

The property.

Return to top
Show: