Class WaveTemplate
  
  Defines a base class for web-related templates
 
  
  
    Inheritance
    System.Object
    
    WaveTemplate
      
      
   
  
  
    Inherited Members
    
    
    
    
    
    
    
    
    
    
    
    
    
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.ToString()
    
   
  
  Assembly: NFX.Wave.dll
  Syntax
  
    public abstract class WaveTemplate : Template<WorkContext, IRenderingTarget, object>, ITemplate
   
  Constructors
  
  
  
  
  WaveTemplate()
  
  
  Declaration
  
  
  
  
  WaveTemplate(WorkContext)
  
  
  Declaration
  
    public WaveTemplate(WorkContext context)
   
  Parameters
  
  Properties
  
  
  
  
  CanReuseInstance
  Override to indicate whetner the instance of the template may be reused for processing of other requests
(possibly by parallel threads). Override to return false if there is any per-request state shared in instance fields
False by default so multiple requests can not reuse the instance
 
  
  Declaration
  
    public override bool CanReuseInstance { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  Overrides
  NFX.Templatization.Template<NFX.Wave.WorkContext, NFX.Templatization.IRenderingTarget, System.Object>.CanReuseInstance
  
  
  
  ContentType
  Override to provides response content type. Default value is HTML
 
  
  Declaration
  
    public virtual string ContentType { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  CSRFToken
  Returns CSRF token for session if it is available or null
 
  
  Declaration
  
    public string CSRFToken { get; }
   
  Property Value
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  Response
  
  
  Declaration
  
    public Response Response { get; }
   
  Property Value
  
  
  
  
  Session
  Returns session if it is available or null
 
  
  Declaration
  
    public WaveSession Session { get; }
   
  Property Value
  
  Methods
  
  
  
  
  DoPostRender(Exception)
  
  
  Declaration
  
    protected override bool DoPostRender(Exception error)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Exception | 
        error | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  Overrides
  NFX.Templatization.Template<NFX.Wave.WorkContext, NFX.Templatization.IRenderingTarget, System.Object>.DoPostRender(System.Exception)
  
  
  
  EscapeJSLiteral(String)
  Escapes JS literal, see NFX.Web.Utils.EscapeJSLiteral
 
  
  Declaration
  
    public static string EscapeJSLiteral(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  HTMLEncode(String)
  Converts string to HTML-encoded string
 
  
  Declaration
  
    public static string HTMLEncode(string value)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        value | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  Render(ResponseRenderingTarget, Object)
  Renders template by generating content into ResponseRenderingTarget
 
  
  Declaration
  
    public void Render(ResponseRenderingTarget target, object model)
   
  Parameters
  
  
  
  
  Render(WorkContext, Object)
  Renders template by generating content into WorkContext
 
  
  Declaration
  
    public void Render(WorkContext work, object model)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | WorkContext | 
        work | 
         | 
      
      
        | System.Object | 
        model | 
         | 
      
    
  
  
  
  
  RenderToString(WorkContext, Boolean, Object)
  Renders template to string in a WorkContext
 
  
  Declaration
  
    public string RenderToString(WorkContext work, bool encodeHtml = true, object model = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | WorkContext | 
        work | 
         | 
      
      
        | System.Boolean | 
        encodeHtml | 
         | 
      
      
        | System.Object | 
        model | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  RenderToString(Boolean, Object)
  Renders template to string
 
  
  Declaration
  
    public string RenderToString(bool encodeHtml = true, object model = null)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Boolean | 
        encodeHtml | 
         | 
      
      
        | System.Object | 
        model | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  Implements
  
  Extension Methods