Razor Functions

Razor is a view engine option for ASP.NET. Experience Management allows you to use the Razor syntax to create and use yet another type of CMS Functions - "Razor functions".

Note: Although Razor is often associated with MVC, you do not need MVC support on yourWebsite to start creating and using Razor functions. If you, however, do need Razor bundled with MVC, please consider using MVC Player.

The Razor functions are available for insertion on pages, templates, in other functions and in function calls in the CMS Console.

Note. To quickly create boilerplate-code Razor functions (as well as Razor page template) from Visual Studio 2012, install an ad-hoc Visual Studio 2012 extension by Experience Management: CompositeC1RazorExtensions.vsix. (It works with Visual Studio 2012 only.)

In this guide, you'll learn how to create, edit and use Razor functions. 

Creating Razor Functions

Learn how to create Razor functions in Experience Management.

Defining Parameters

Learn how to define parameters in Razor functions.

Changing Widgets

Learn how to change widgets for Razor function parameters.

Changing Return Types

Learn how to change types of return values in Razor functions.

Getting Data

Learn how to get data in Razor functions.

Rendering URLs

Learn how to render Page URLs and Media URLs in Razor functions.

Execute Other Functions

Learn how to execute other functions in Razor functions.

List to Details

Learn how to create a simple List-to-Details function for CMS Pages using Razor.

Samples

Learn by example and check a few sample Razor functions.

Advanced Setup

Learn how to change the root folder for your .cshtml files (Razor functions) and do other advanced setup tasks.

Getting Error Info

Learn how to get error information on Razor functions.