Share via


AreaRegistration.RegisterAllAreas Method (Object)

Registers all areas in an ASP.NET MVC application by using the specified user-defined information.

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

Syntax

'Declaration
Public Shared Sub RegisterAllAreas ( _
    state As Object _
)
public static void RegisterAllAreas(
    Object state
)
public:
static void RegisterAllAreas(
    Object^ state
)

Parameters

  • state
    Type: System.Object
    An object that contains user-defined information to pass to the area.

Remarks

The RegisterAllAreas method finds all types in the application domain that derive from AreaRegistration and calls each of their RegisterArea methods.

The state parameter enables you to pass any kind of information to the area that is being registered. For example, you might want the area to have some or all of the following information:

  • A reference to the HttpApplication object.

  • Repository information.

  • A reference to a log.

  • A reference to an Inversion of Control (IOC) container.

See Also

Reference

AreaRegistration Class

RegisterAllAreas Overload

System.Web.Mvc Namespace