Skip to main content
Logo
There is a newer version of Contensis. Click to find out more and download the latest version.

Write Inline Razor

When you need to insert small snippets of razor, it can be frustrating to have to create a Razor view, submit and approve it before inserting it into a template or page. This article will walk you through how to write inline razor with the help of an inline razor control.

  1. Right click on a page in the WYSIWYG editor where you want the control to be placed.
  2. Select Insert Web Control from the context menu. Navigate to Standard.
  3. Select Inline Razor for the fly out menu – a dialog window will open.
  4. Select the language that you writing your Razor in (we recommend c# - that’s the default).
  5. Type the Razor you want to appear on the page.

Using Razor via WebDAV

If you work locally using WebDAV, you can take advantage of the new inline razor control as well as referencing Razor files by using the following syntax:

Inline Razor View Web Control Syntax

Inline Razor View File Syntax