For developers: Develop with Sitefinity and ASP.NET MVC
Sitefinity’s multi-layer architecture is designed and built around the key concepts of extensibility, interoperability, integration, and flexibility. Sitefinity CMS provides you with choices of how to implement your logic and meeting your requirements, for example working with third-party software and utilizing various approaches on how to solve a problem. Such an example is working with ASP.NET MVC framework to build websites and interfaces, widgets, interactions, and applications.
You can use either one technology, or use both of them, depending on your development needs and requirements. Developers with an MVC background can implement custom controllers and views that can be also used in a Sitefinity CMS project. With Sitefinity CMS, you can combine both WebForms and MVC widgets and use them on the same page. You can create new functionality using MVC, whilst not breaking anything that you are currently working with.
MVC controllers and Sitefinity CMS widgets
With Sitefinity CMS, you can leverage the classic, pure, and hybrid modes of MVC. The mode you use depends on your development process as well as the functionality you want to implement. The classic mode, as the name suggests, is the mode in which a page is represented by one controller (in essence, bypassing Sitefinity CMS page routes) – as it is outside of the context of Sitefinity CMS. The pure and hybrid modes are Sitefinity-specific and bring ASP.NET MVC with a Sitefinity CMS implementation. Namely, controllers are interpreted as widgets, so you can build Sitefinity CMS widgets from controllers and have more than one controller within a page. For more information, see MVC modes.
Features
- Directly register MVC code as Sitefinity CMS widgets
You can directly integrate your MVC code (models, views, and controllers) by adding a simple attribute to register your controller, so it becomes available to end users to place onto pages using drag and drop. You can also work in a hybrid development environment, where your WebForms controls and MVC widgets can live together.
- Full Razor support
The MVC engine in Sitefinity CMS gives you full control over markup that your custom widgets generate, including full Razor support. You can build your views by using various template engines and, in addition, use Kendo UI framework.
- API that works for model binding in Sitefinity CMS
ASP.NET MVC exposes an API that allows you to easily perform any operation to any object controlled by the system, therefore allowing you to meet any user experience, functional, or integration requirement. In addition, the majority of the API methods work seamlessly with LINQ and return objects and collections that automatically bind to your Razor views.
- Control over routing
Sitefinity CMS works with the MVC routing engine, which provides rich features that allow you to control the URL structure of any resource out of the box. In the same time, you can use the convention-based routing within your controllers. In case you also need control over custom routes, you have full access to the Route Table.
- Work with Sitefinity CMS Thunder
Sitefinity CMS Thunder boosts your Sitefinity CMS MVC development productivity by providing Visual Studio templates for all the basics, as well as wizards for some of the Sitefinity CMS added extras, such as enabling users to change some of the properties of MVC widgets through edit screens.
- Dynamic data and dynamic content types
Sitefinity CMS Module Builder enables you to instantly create a data layer for any scenario. For any other content type requirement, all you need to do is define the metafields that you need and Sitefinity CMS builds the content type and automatically provides the full infrastructure - back-end screens with media fields, taxonomy fields, many-to-many relationships and so on. In addition, Sitefinity CMS exposes the full API, so you can use it in your MVC controllers
Sitefinity CMS and Feather
You can also use Sitefinity CMS Feather framework for even more simplified development and easily build user interfaces.
Sitefinity CMS Feather introduces a modern, convention-based, mobile-first UI framework for Telerik Sitefinity CMS. It allows developers to build mobile-ready sites using their favorite frameworks and includes MVC stock widgets, an AngularJS widget designer framework, Bootstrap, Foundation and Semantic UI support, and more. For more information, see Feather.
MVC development considerations
Before you start working with ASP.NET MVC in Sitefinity CMS, take a look at the following common questions regarding MVC:
For more information about the differences between the two models, see For developers: ASP.NET MVC or Web forms.
Question |
Answer |
Is Sitefinity CMS rewritten in ASP.NET MVC? |
No. Sitefinity CMS only supports ASP.NET MVC controllers and views but the CMS itself still works with WebForms. |
Will Sitefinity CMS continue to support the WebForms model? |
Yes. You can can continue working with everything you are already using with the WebForms model. |
Are you going to develop new features with WebForms? |
Yes. Apart from the support for WebForms, Sitefinity CMS invests in the WebForms model and continues introducing related features. |
Do I have to use ASP.NET MVC? |
You decide whether the WebForms or the ASP.NET MVC model suits your needs better. You can use both models. |
IMPORTANT:
To make sure you are working with the accurate ASP.NET MVC version, check System requirements.
IMPORTANT:
Sitefinity CMS supports just the Razor view engine and C# for ASP.NET MVC views. You can, however, write WebForms controls with ASCX markup, but all ASP.NET MVC views must use Razor and C#.
For more information about the three ASP.NET MVC modes and how you can work with them, see
For developers: MVC modes.