Create an AreaRegistration class

You create the AreaRegistration class to map one or more routes. The routes define the template of the URL used to navigate to the different views. 

To create an area registration class for your application:

  1. In Visual Studio, navigate to Areas » BugTracker folder and create a new class.
    Name the class BugTrackerAreaRegistration.
  2. Make your class inherit the AreaRegistration class.
    The AreaRegistration class is located under the System.Web.Mvc namespace.
  3. Implement the abstract members of the AreaRegistration class.
    The AreaRegistration class has the following abstract members:
    • AreaName
      A property that returns the name of your area.
    • RegisterArea
      A method that is used to map a route for your area.
  4. Configure the AreaName property to return the name of your area.
    In the getter of the property, return the “BugTracker” value.
  5. In the RegisterArea method, map a route for your area:
    1. Call the MapRoute method of the context argument.
    2. As the name argument pass the name of your route.
    3. As the url argument pass the template of your URLs.
    4. As the defaults argument pass the default values for the action and the id elements of the URL.
      The default action in the BugTracker sample is Index (that is, querying of the available content items) and the default ID is an empty string.

GITHUB EXAMPLE: For more information about the content of the file, see the BugTrackerAreaRegistration.cs file of the downloaded sample project.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?