Click or drag to resize

RazorTemplateBase<TModel> Class

Base class for razor based templates.
Inheritance Hierarchy
System.Object
  TemplateBase
    TemplateBase<TModel>
      Dynamicweb.Rendering.TemplateBase<TModel>
        Dynamicweb.Rendering.RazorTemplateBase<TModel>

Namespace:  Dynamicweb.Rendering
Assembly:  Dynamicweb (in Dynamicweb.dll) Version: 9.10.0
Syntax
public class RazorTemplateBase<TModel> : TemplateBase<TModel>

Type Parameters

TModel
The type of the Razor template model.

The RazorTemplateBase<TModel> type exposes the following members.

Constructors
  NameDescription
Public methodRazorTemplateBase<TModel>
Initializes a new instance of the RazorTemplateBase<TModel> class
Top
Properties
  NameDescription
Public propertyConsents
Gets the consents.
(Inherited from TemplateBase<T>.)
Public propertyCurrentWriter
Gets the current writer.
(Inherited from TemplateBase.)
Protected propertyHasDynamicModel
Determines whether this template has a dynamic model.
(Inherited from TemplateBase<TModel>.)
Public propertyInternalTemplateService
Gets or sets the template service.
(Inherited from TemplateBase.)
Public propertyLayout
Gets or sets the layout template name.
(Inherited from TemplateBase.)
Public propertyLoops
Returns a list of loops on this instance.
Public propertyModel
Gets or sets the model.
(Inherited from TemplateBase<TModel>.)
Public propertyNavigation (Inherited from TemplateBase<T>.)
Public propertyPageview
Gets the pageview of the current pageview.
(Inherited from TemplateBase<T>.)
Public propertyRazor
Gets or sets the current IRazorEngineService instance.
(Inherited from TemplateBase.)
Public propertyRazorEngine Obsolete.
Gets or sets the current IRazorEngineService instance.
(Inherited from TemplateBase.)
Public propertyTemplateService Obsolete.
Gets or sets the template service.
(Inherited from TemplateBase.)
Public propertyValues
Gets the raw values of templates tags in a Dictionary. The key is the name of the tag, the value is value of the tag.
Public propertyViewBag
Gets the viewbag that allows sharing state between layout and child templates.
(Inherited from TemplateBase.)
Top
Methods
  NameDescription
Public methodContentPlaceholder
Insert template content in master template
(Inherited from TemplateBase<T>.)
Public methodDefineSection
Defines a section that can written out to a layout.
(Inherited from TemplateBase.)
Public methodDescription
Define template description
(Inherited from TemplateBase<T>.)
Public methodExecute
Executes the compiled template.
(Inherited from TemplateBase.)
Public methodGetBoolean
Gets a boolean representation of the tag value.
Public methodGetDate
Gets a date representation of the tag value.
Public methodGetDouble
Gets a double representation of the tag value.
Public methodGetGlobalValue
Gets a value from the global tags collection.
Public methodGetInteger
Gets a integer representation of the tag value.
Public methodGetLong
Gets a string representation of the tag value.
Public methodGetLoop
Public methodGetPageIdByNavigationTag
Gets the page id with the specified navigation tag.
(Inherited from TemplateBase<T>.)
Public methodGetString
Gets a string representation of the tag value.
Public methodGetValue
Gets the value.
Public methodInclude(String)
Includes the file specified before the razor template is compiled.
Public methodInclude(String, Object)
Includes the template with the specified name.
(Inherited from TemplateBase<TModel>.)
Public methodInclude(String, String)
Includes the file specified before the razor template is compiled.
Public methodInclude(String, Object, Type)
Includes the template with the specified name.
(Inherited from TemplateBase<TModel>.)
Public methodIncludeFile(String)
Includes the file specified before the razor template is compiled.
(Inherited from TemplateBase<T>.)
Public methodIncludeFile(String, String)
Includes the file specified before the razor template is compiled.
Public methodIsSectionDefined
Determines if the section with the specified name has been defined.
(Inherited from TemplateBase.)
Public methodMasterPageFile
Use master page file
(Inherited from TemplateBase<T>.)
Public methodPushPromise
Support for sending push promises to HTTP 2.0 clients. Call this method for static ressources and images that the current response will trigger new requests for. Typically js, css and image files.
(Inherited from TemplateBase<T>.)
Public methodRaw
Returns the specified string as a raw string. This will ensure it is not encoded.
(Inherited from TemplateBase.)
Public methodRenderBody
Renders the body of the template.
(Inherited from TemplateBase.)
Public methodCode exampleRenderItem
Render a single item from settings defined on an (anonymous) object
(Inherited from TemplateBase<T>.)
Public methodCode exampleRenderItemCreationForm
Render item creating form from settings defined on an (anonymous) object
(Inherited from TemplateBase<T>.)
Public methodCode exampleRenderItemList
Render item list from settings defined on an (anonymous) object
(Inherited from TemplateBase<T>.)
Public methodCode exampleRenderNavigation
Render xml navigation from settings defined on an (anonymous) object
(Inherited from TemplateBase<T>.)
Public methodRenderPageContent
Render page content
(Inherited from TemplateBase<T>.)
Public methodRenderParagraphContent
Render paragraph content
(Inherited from TemplateBase<T>.)
Public methodRenderSection
Renders the section with the specified name.
(Inherited from TemplateBase.)
Public methodRenderSnippet
Add snippet placeholder
(Inherited from TemplateBase<T>.)
Protected methodResolveLayout
Resolves the layout template.
(Inherited from TemplateBase<TModel>.)
Public methodResolveUrl
Resolves the specified path
(Inherited from TemplateBase.)
Public methodSetData
Set the data for this template.
(Inherited from TemplateBase.)
Public methodSetModel
Set the model.
(Inherited from TemplateBase<TModel>.)
Public methodSnippetEnd
End a snippet
(Inherited from TemplateBase<T>.)
Public methodSnippetStart
Start a snippet
(Inherited from TemplateBase<T>.)
Public methodTemplateTags()
Prints a table of the template tags in the current template instance.
Public methodTemplateTags(String)
Prints a table of the template tags containing the search string in the current template instance.
Public methodTitle (Inherited from TemplateBase<T>.)
Public methodToJson
Serializes the data in the template instance to json.
Public methodTranslate(String)
Translates a text using the current language and design context.
(Inherited from TemplateBase<T>.)
Public methodTranslate(String, String)
Translates a text using the current language and design context using a specified default translation if no translation exists.
(Inherited from TemplateBase<T>.)
Public methodTranslate(String, String, String)
Translates a text using the current language and design context using a specified default translation if no translation exists.
(Inherited from TemplateBase<T>.)
Public methodWrite(Object)
Writes the specified object to the result.
(Inherited from TemplateBase.)
Public methodWrite(TemplateWriter)
Writes the specified template helper result.
(Inherited from TemplateBase.)
Public methodWriteAttribute
Writes an attribute to the result.
(Inherited from TemplateBase.)
Public methodWriteAttributeTo
Writes an attribute to the specified TextWriter.
(Inherited from TemplateBase.)
Public methodWriteLiteral
Writes the specified string to the result.
(Inherited from TemplateBase.)
Public methodWriteLiteralTo
Writes a string literal to the specified TextWriter.
(Inherited from TemplateBase.)
Public methodWriteTo(TextWriter, Object)
Writes the specified object to the specified TextWriter.
(Inherited from TemplateBase.)
Public methodWriteTo(TextWriter, TemplateWriter)
Writes the specfied template helper result to the specified writer.
(Inherited from TemplateBase.)
Top
Fields
  NameDescription
Protected field_context
The current context, filled when we are currently writing a template instance.
(Inherited from TemplateBase.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodRazorEngine#Templating#ITemplate#Run
Runs the template and returns the result.
(Inherited from TemplateBase.)
Top
See Also