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


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.


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