ScriptHelper Class
Script Helper that is injected into the script as a global Script
variable
To use:
{{ Script.RenderPartial("./test.template") }}
Westwind.Scripting.ScriptHelper
Class Members
Member | Description | |
---|---|---|
![]() |
Constructor | |
![]() |
CallMethod | Calls a method on an object dynamically.This version doesn't require specific parameter signatures to be passed.Instead parameter types are inferred based on types passed. Note that ifyou pass a null…
public object CallMethod(object instance, string method,
object[] parms)
|
![]() |
EndSection |
public string EndSection(string sectionName)
|
![]() |
GetProperty | Retrieve a property value from an object dynamically. This is a simple versionthat uses Reflection calls directly. It doesn't support indexers.
public object GetProperty(object instance, string property)
|
![]() |
HtmlEncode | Encodes a value using Html Encoding by first converting
public string HtmlEncode(object value)
|
![]() |
Raw | Returns a raw string that is Html Encoded evenif encoding by default is enabled or an explicit{{: }} block is used.
public RawString Raw(string value)
|
![]() |
RenderContent | Used in a Layout Page to indicate where the content should be rendered
public void RenderContent()
|
![]() |
RenderPartial | Renders a partial file into the template
public string RenderPartial(string scriptPath, object model)
|
![]() |
RenderPartialAsync | Renders a partial file into the template
public Task
|
![]() |
RenderScript | Renders a string of script to effectively allow recursiverendering of content into a fixed template
public string RenderScript(string script, object model)
|
![]() |
RenderScriptAsync | Renders a string of script to effectively allow recursiverendering of content into a fixed template
public Task
|
![]() |
RenderSection |
public void RenderSection(string sectionName)
|
![]() |
Section |
public string Section(string sectionName)
|
![]() |
BasePath | This the base path that's used for ~/ or / paths when using RenderTemplateThis value is null by default and if not set the current working directoryis used instead. |
![]() |
IsPreview | |
![]() |
Layout | |
![]() |
Title | Optional Page Title - useful in HTML Pages that use Layout topass the title to the Layout page |
Assembly: Westwind.Scripting.dll