Class RazorTemplateBase<TModel>

Base class used for Razor Page Templates - Razor generates a class from the parsed Razor markup and this class is the base class. Class must implement an Execute() method that is overridden by the parser and contains the code that generates the markup. Write() and WriteLiteral() must be implemented to handle output generation inside of the Execute() generated code.

This class can be subclassed to provide custom functionality. One common feature likely will be to provide Context style properties that are application specific (ie. HelpBuilderContext) and strongly typed and easily accesible in Razor markup code.

System.Object
  System.MarshalByRefObject
    Westwind.RazorHosting.RazorTemplateBase
      Westwind.RazorHosting.RazorTemplateBase<TModel>
public class RazorTemplateBase<TModel> : RazorTemplateBase

Class Members

MemberDescription

Constructor

InitializeTemplate

This method is called upon instantiation and allows passing custom configuration data to the template from the Engine.

This method can then be overridden

public virtual void InitializeTemplate(object model,     object configurationData)

Model

Create a strongly typed model

Requirements

Namespace: Westwind.RazorHosting
Assembly: westwind.razorhosting.dll

© West Wind Technologies, 2018 • Updated: 06/07/18
Comment or report problem with topic