ValueExtensions Class

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

Inheritance Hierarchy

System.Object
  System.Web.Mvc.Html.ValueExtensions

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

Syntax

'Declaration
<ExtensionAttribute> _
Public NotInheritable Class ValueExtensions
'Usage
public static class ValueExtensions
[ExtensionAttribute]
public ref class ValueExtensions abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type ValueExtensions =  class end
public final class ValueExtensions

Methods

  Name Description
Public methodStatic member Value(HtmlHelper, String) Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic member Value(HtmlHelper, String, String) Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic member 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 methodStatic member 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 methodStatic member ValueForModel(HtmlHelper) Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic member ValueForModel(HtmlHelper, String) Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.

Top

Remarks

The following code example shows how to create custom helper.

@helper TextBoxFor(Expression<Func<object, TProperty>> expression) {
     <input type="text" value="@Html.ValueFor(expression)" 
         name="@Html.NameFor(expression)">
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Mvc.Html Namespace