IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
First, you should implement your custom controller, view and model that you want to use in classic mode. To learn how it’s done, read For developers: Create custom models, controllers, and views . After you have your controller, you should register a route for it.
This step is a little different in Sitefinity CMS, because of the specifics of its MVC support. Instead of using the RouteTable directly, you have to use the Bootstrapper class to register routes.
protected
void
Application_Start(
object
sender, EventArgs e)
{
Bootstrapper.MVC.MapRoute(
"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 (workflow, authentication, etc.), and 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 For developers: Pure MVC mode.
In the registration itself, the only difference with a regular ASP.NET MVC project is that we use Bootstrapper.MVC instead of RouteTable. This is required to let Sitefinity CMS know about your custom route and avoid duplications. Custom routes will always have to come after Sitefinity CMS routes. For more information, read For developers: MVC modes and ASP.NET Routing on MSDN.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important