icon MVC Player
Created by Orckestra

How to integrate an ASP.NET MVC 3 application within a CMS Website

  1. In the Content perspective, edit a page, or in the Layout perspective, edit a template.
  2. Insert the Composite.AspNet.MvcPlayer.Render function ( Insert> Function) or add the following code:
    Expand code
  3. Specify the path to the controller/action/id in the Path parameter, e.g. "/Home".

Important Notes

  1. The Razor syntax is supported.
  2. Multiple MVC Player instances cannot run on the same page. (The MVC Player gets the path from either the PathInfo or its parameter if the PathInfo is empty. Multiple MVC Player functions on the same page will thus get the same path from the PathInfo.)
  3. Routes must be registered in ~\App_Code\Composite\AspNet\MvcPlayer\Route.cs instead of Global.asax.
  4. The markup you create in your MVC application must be valid XHTML (closing tags, quotes around attribute values, no raw '<', '&' and other similar characters). To avoid validation errors with script code:
    1. Option 1: (recommended) Put scripts in separate files and insert them in the markup via <script src="..." />
    2. Option 2: Use CDATA to enclose the text to be ignored by the XML parser.