Add ASP.NET MVC applications to your website

Being an ASP.NET-based content management system, C1 CMS allows you to integrate ASP.NET MVC Web applications within your website.

MVC Functions

The recommended approach is, to turn MVC controllers and actions into regular CMS Functions. For this approach, you need to install the MVC Functions add-on (Composite.AspNet.MvcFunctions).

You don't need to change anything in the code of your existing MVC applications.

Simply register these controllers/actions as the functions with a few lines of code (for example, on the application startup) to make them available across your C1 CMS.

FunctionCollection.RegisterAction<SearchController>("Index", "Demo.Search")
    .AddParameter("PageSize", label: "Page Size")
    .AddParameter("CurrentSiteOnly", label: "Show on the current site only");

There is another approach with the MVC Functions. If you don't mind changing the code in your controllers/actions, decorate them with MVC Functions specific attributes. C1 CMS will then auto-discover them as CMS Functions.

Please see the MVC Functions documentation for more information.

Please also see Hello World MVC for a quick guide to using an MVC application as a CMS Function.

MVC Player

Important. The use of MVC Player is deprecated and discouraged. Please MVC Functions instead (see above).

You can also embed your MVC application on your website by using the MVC Player add-on (Composite.AspNet.MvcPlayer).

You can also choose to use the Razor syntax in MVC applications, which C1 CMS supports, too.