Table of Contents

Class HtmlHelper<TModel>

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

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

public class HtmlHelper<TModel> : HtmlHelper

Type Parameters

TModel

The type of the model.

Inheritance
HtmlHelper<TModel>
Inherited Members
Extension Methods

Constructors

HtmlHelper(ViewContext, IViewDataContainer)

Initializes a new instance of the HtmlHelper<TModel> class by using the specified view context and view data container.

public HtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContainer)

Parameters

viewContext ViewContext

The view context.

viewDataContainer IViewDataContainer

The view data container.

HtmlHelper(ViewContext, IViewDataContainer, RouteCollection)

Initializes a new instance of the HtmlHelper<TModel> class by using the specified view context, view data container, and route collection.

public HtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection)

Parameters

viewContext ViewContext

The view context.

viewDataContainer IViewDataContainer

The view data container.

routeCollection RouteCollection

The route collection.

Properties

ViewBag

Gets the view bag.

public dynamic ViewBag { get; }

Property Value

dynamic

The view bag.

ViewData

Gets the strongly typed view data dictionary.

public ViewDataDictionary<TModel> ViewData { get; }

Property Value

ViewDataDictionary<TModel>

The strongly typed view data dictionary.