Skip to main content

Reusing Templates and Code Tutorials

Tutorial HomeReuse

Re-using templates and code

This will show you how to place partial templates into separate files, and how to put functions you need in many places in separate files as well. It focuses on RenderPage and CreateInstance. You'll see the sources of the other files at the bottom of this page.

Reusing Shared Stuff Examples

  1. Reuse template with @RenderPage
  2. Reuse Razor Helpers (mini-templates) with CreateInstance
  3. Reuse a function library CreateInstance
  4. Reuse code with .cs files new in v10
    CreateInstance is enhanced in 2sxc 10.01 to support .cs files to share code across Razor files and WebApi Controllers.
  5. Split Razor Templates into C#-Code and Template new in v11
    Now you can split out complicated C# code so designers don't have to worry about it.