Share via


ValueExtensions.ValueForModel Method (HtmlHelper)

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)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ValueForModel ( _
    html As HtmlHelper _
) As MvcHtmlString
'Usage
Dim html As HtmlHelper 
Dim returnValue As MvcHtmlString 

returnValue = html.ValueForModel()
public static MvcHtmlString ValueForModel(
    this HtmlHelper html
)
[ExtensionAttribute]
public:
static MvcHtmlString^ ValueForModel(
    HtmlHelper^ html
)
static member ValueForModel : 
        html:HtmlHelper -> MvcHtmlString
public static function ValueForModel(
    html : HtmlHelper
) : MvcHtmlString

Parameters

Return Value

Type: System.Web.Mvc.MvcHtmlString
The HTML markup for the value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).

See Also

Reference

ValueExtensions Class

ValueForModel Overload

System.Web.Mvc.Html Namespace