HtmlHelper Constructor

 

Initializes a new instance of the HtmlHelper class.

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

NameDescription
System_CAPS_pubmethodHtmlHelper(ViewContext, IViewDataContainer)

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

System_CAPS_pubmethodHtmlHelper(ViewContext, IViewDataContainer, RouteCollection)

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

Return to top

HtmlHelper Constructor (ViewContext, IViewDataContainer)

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

public HtmlHelper(
	ViewContext viewContext,
	IViewDataContainer viewDataContainer
)

Parameters

viewContext
Type: System.Web.Mvc.ViewContext

The view context.

viewDataContainer
Type: System.Web.Mvc.IViewDataContainer

The view data container.

Exception Condition
ArgumentNullException

The ViewContext or the viewDataContainer parameter is null.

Return to top

HtmlHelper Constructor (ViewContext, IViewDataContainer, RouteCollection)

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

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

Parameters

viewContext
Type: System.Web.Mvc.ViewContext

The view context.

viewDataContainer
Type: System.Web.Mvc.IViewDataContainer

The view data container.

routeCollection
Type: System.Web.Routing.RouteCollection

The route collection.

Exception Condition
ArgumentNullException

One or more parameters is null.

Return to top
Show: