Classic MVC mode

Classic MVC mode is an integral part of ASP.NET MVC development and is thus familiar to most developers in this field. Classic MVC mode comprises of plain controllers and views and the only area it differs from other MVC modes is the way you register your routes.

You first implement your custom controller, view, and model that you want to use in classic mode. For more information, see For developers: Create custom models, controllers, and views

Next, you register a route for your implemented controller.

Register a route

This step differs slightly that registering a route in Sitefinity CMS because of the specifics of Sitefinity CMS MVC support. The following code sample demonstrates how to register a route in classic MVC mode:

C#
using System;
using Telerik.Sitefinity.Abstractions;

namespace SitefinityWebApp
{
   public class Global1 : System.Web.HttpApplication
   {

       protected void Application_Start(object sender, EventArgs e)
       {
           Bootstrapper.Bootstrapped += Bootstrapper_Bootstrapped;
       }

       private void Bootstrapper_Bootstrapped(object sender, EventArgs e)
       {
           System.Web.Mvc.RouteCollectionExtensions.MapRoute(System.Web.Routing.RouteTable.Routes,

                "Classic",
                "customprefix/{controller}/{action}/{id}",

                new { controller = "Feature", action = "Index", id = (string)null }
            );
       }
   }
}

IMPORTANT: We recommend that you register all your routes with a prefix to differentiate them from the ones used by Sitefinity CMS. There are a lot of internal routes for system features (for example, workflow, authentication, and so on), so this is the best way to avoid clashes. If you want to register routes that start from the root of the application, we recommend using pure MVC mode.

For more information, see:

Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
This Article Contains
New to Sitefinity?