Export (0) Print
Expand All

HtmlHelper<TModel> Class

Represents support for rendering HTML controls in a strongly typed view.

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

public class HtmlHelper<TModel> : HtmlHelper
where TModel : class

Type Parameters

TModel

The type of the model.

The HtmlHelper<TModel> class is a strongly typed subclass of the HtmlHelper class. The HtmlHelper class provides a set of helper methods whose purpose is to help you create HTML controls programmatically. All HtmlHelper methods generate plain HTML and return the result as a string.

Extensions to the HtmlHelper class are located in the System.Web.Mvc.Html namespace. These extensions add helper methods for creating forms, rendering HTML controls, rendering partial views, input validation, and more.

All helper methods and extensions are called using the Html property of the view, which is an instance of the HtmlHelper class. For example, to generate a check box in your form, you would call the Html.CheckBox method.

System.Object
  System.Web.Mvc.HtmlHelper
    System.Web.Mvc.HtmlHelper<TModel>

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

Community Additions

Show:
© 2014 Microsoft