Export (0) Print
Expand All

ValueExtensions Class

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

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

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

public final class ValueExtensions

  NameDescription
Public methodStatic memberValue(HtmlHelper, String)Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic memberValue(HtmlHelper, String, String)Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic memberValueFor(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 memberValueFor(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 memberValueForModel(HtmlHelper)Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Public methodStatic memberValueForModel(HtmlHelper, String)Provides a mechanism to create custom HTML markup compatible with the ASP.NET MVC model binders and templates.
Top

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)">
}

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