Skip to main content

PageResult

Assembly: ServiceStack.Common.dll
View Source
Declaration
public class PageResult : IPageResult, IStreamWriterAsync, IHasOptions, IDisposable

Properties

Page

The Page to Render

View Source
Declaration
public SharpPage Page { get; }

CodePage

The Code Page to Render

View Source
Declaration
public SharpCodePage CodePage { get; }

LayoutPage

Use specified Layout

View Source
Declaration
public SharpPage LayoutPage { get; set; }

Layout

Use Layout with specified name

View Source
Declaration
public string Layout { get; set; }

NoLayout

Render without any Layout

View Source
Declaration
public bool NoLayout { get; set; }

Model

Extract Model Properties into Scope Args

View Source
Declaration
public object Model { get; set; }

Args

Add additional Args available to all pages

View Source
Declaration
public Dictionary<string, object> Args { get; set; }

ScriptMethods

Add additional script methods available to all pages

View Source
Declaration
public List<ScriptMethods> ScriptMethods { get; set; }

TemplateFilters

View Source
Declaration
[Obsolete("Use ScriptMethods")]
public List<ScriptMethods> TemplateFilters { get; }

ScriptBlocks

Add additional script blocks available to all pages

View Source
Declaration
public List<ScriptBlock> ScriptBlocks { get; set; }

TemplateBlocks

View Source
Declaration
[Obsolete("Use ScriptBlocks")]
public List<ScriptBlock> TemplateBlocks { get; }

Partials

Add additional partials available to all pages

View Source
Declaration
public Dictionary<string, SharpPage> Partials { get; set; }

Options

Return additional HTTP Headers in HTTP Requests

View Source
Declaration
public IDictionary<string, string> Options { get; set; }

ContentType

Specify the Content-Type of the Response

View Source
Declaration
public string ContentType { get; set; }

PageTransformers

Transform the Page output using a chain of stream transformers

View Source
Declaration
public List<Func<Stream, Task<Stream>>> PageTransformers { get; set; }

OutputTransformers

Transform the entire output using a chain of stream transformers

View Source
Declaration
public List<Func<Stream, Task<Stream>>> OutputTransformers { get; set; }

FilterTransformers

Available transformers that can transform context filter stream outputs

View Source
Declaration
public Dictionary<string, Func<Stream, Task<Stream>>> FilterTransformers { get; set; }

ExcludeFiltersNamed

Don't allow access to specified filters

View Source
Declaration
public HashSet<string> ExcludeFiltersNamed { get; }

LastFilterError

The last error thrown by a filter

View Source
Declaration
public Exception LastFilterError { get; set; }

LastFilterStackTrace

The StackTrace where the Last Error Occured

View Source
Declaration
public string[] LastFilterStackTrace { get; set; }

AssignExceptionsTo

What argument errors should be binded to

View Source
Declaration
public string AssignExceptionsTo { get; set; }

CatchExceptionsIn

What argument captured errors should be binded to

View Source
Declaration
public string CatchExceptionsIn { get; set; }

SkipFilterExecution

Whether to skip execution of all page filters and just write page string fragments

View Source
Declaration
public bool SkipFilterExecution { get; set; }

SkipExecutingFiltersIfError

Overrides Context to specify whether to Ignore or Continue executing filters on error

View Source
Declaration
public bool? SkipExecutingFiltersIfError { get; set; }

RethrowExceptions

Whether to always rethrow Exceptions

View Source
Declaration
public bool RethrowExceptions { get; set; }

HaltExecution

Immediately halt execution of the page

View Source
Declaration
public bool HaltExecution { get; set; }

DisableBuffering

Whether to disable buffering output and render directly to OutputStream

View Source
Declaration
public bool DisableBuffering { get; set; }

ReturnValue

The Return value of the page (if any)

View Source
Declaration
public ReturnValue ReturnValue { get; set; }

StackDepth

The Current StackDepth

View Source
Declaration
public int StackDepth { get; }

PartialStackDepth

The Current StackDepth of rendering partials

View Source
Declaration
public int PartialStackDepth { get; }

Evaluations

Can be used to track number of Evaluations

View Source
Declaration
public long Evaluations { get; }

Context

View Source
Declaration
public ScriptContext Context { get; }

Format

View Source
Declaration
public PageFormat Format { get; }

VirtualPath

View Source
Declaration
public string VirtualPath { get; }

ResultOutput

View Source
Declaration
public string ResultOutput { get; }

Result

View Source
Declaration
public string Result { get; }

Methods

AssertNextEvaluation()

View Source
Declaration
public void AssertNextEvaluation()

AssertNextPartial()

View Source
Declaration
public void AssertNextPartial()

ResetIterations()

View Source
Declaration
public void ResetIterations()

AssignArgs(Dictionary<String, Object>)

View Source
Declaration
public PageResult AssignArgs(Dictionary<string, object> args)
Returns

ServiceStack.Script.PageResult

Parameters
TypeName
System.Collections.Generic.Dictionary<System.String,System.Object>args

WriteToAsync(Stream, CancellationToken)

View Source
Declaration
public async Task WriteToAsync(Stream responseStream, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.IO.StreamresponseStream
System.Threading.CancellationTokentoken

WritePageFragmentAsync(ScriptScopeContext, PageFragment, CancellationToken)

View Source
Declaration
public async Task WritePageFragmentAsync(ScriptScopeContext scope, PageFragment fragment, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
ServiceStack.Script.PageFragmentfragment
System.Threading.CancellationTokentoken

WriteStatementsAsync(ScriptScopeContext, IEnumerable<JsStatement>, String, CancellationToken)

View Source
Declaration
public Task WriteStatementsAsync(ScriptScopeContext scope, IEnumerable<JsStatement> blockStatements, string callTrace, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Collections.Generic.IEnumerable<ServiceStack.Script.JsStatement>blockStatements
System.StringcallTrace
System.Threading.CancellationTokentoken

WriteStatementsAsync(ScriptScopeContext, IEnumerable<JsStatement>, CancellationToken)

View Source
Declaration
public async Task WriteStatementsAsync(ScriptScopeContext scope, IEnumerable<JsStatement> blockStatements, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
System.Collections.Generic.IEnumerable<ServiceStack.Script.JsStatement>blockStatements
System.Threading.CancellationTokentoken

ShouldSkipFilterExecution(PageVariableFragment)

View Source
Declaration
public bool ShouldSkipFilterExecution(PageVariableFragment var)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Script.PageVariableFragmentvar

ShouldSkipFilterExecution(PageFragment)

View Source
Declaration
public bool ShouldSkipFilterExecution(PageFragment fragment)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Script.PageFragmentfragment

ShouldSkipFilterExecution(JsStatement)

View Source
Declaration
public bool ShouldSkipFilterExecution(JsStatement statement)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.Script.JsStatementstatement

Init()

View Source
Declaration
public async Task<PageResult> Init()
Returns

System.Threading.Tasks.Task<ServiceStack.Script.PageResult>

WritePageAsync(SharpPage, SharpCodePage, ScriptScopeContext, CancellationToken)

View Source
Declaration
public Task WritePageAsync(SharpPage page, SharpCodePage codePage, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.SharpPagepage
ServiceStack.Script.SharpCodePagecodePage
ServiceStack.Script.ScriptScopeContextscope
System.Threading.CancellationTokentoken

WritePageAsync(SharpPage, ScriptScopeContext, CancellationToken)

View Source
Declaration
public async Task WritePageAsync(SharpPage page, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.SharpPagepage
ServiceStack.Script.ScriptScopeContextscope
System.Threading.CancellationTokentoken

WriteCodePageAsync(SharpCodePage, ScriptScopeContext, CancellationToken)

View Source
Declaration
public async Task WriteCodePageAsync(SharpCodePage page, ScriptScopeContext scope, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.SharpCodePagepage
ServiceStack.Script.ScriptScopeContextscope
System.Threading.CancellationTokentoken

WriteVarAsync(ScriptScopeContext, PageVariableFragment, CancellationToken)

View Source
Declaration
public async Task WriteVarAsync(ScriptScopeContext scope, PageVariableFragment var, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
ServiceStack.Script.PageVariableFragmentvar
System.Threading.CancellationTokentoken

ParseJsExpression(ScriptScopeContext, ReadOnlySpan<Char>, out JsToken)

View Source
Declaration
public ReadOnlySpan<char> ParseJsExpression(ScriptScopeContext scope, ReadOnlySpan<char> literal, out JsToken token)
Returns

ReadOnlySpan<System.Char>

Parameters
TypeName
ServiceStack.Script.ScriptScopeContextscope
ReadOnlySpan<System.Char>literal
ServiceStack.Script.JsTokentoken

TryGetBlock(String)

View Source
Declaration
public ScriptBlock TryGetBlock(string name)
Returns

ServiceStack.Script.ScriptBlock

Parameters
TypeName
System.Stringname

GetBlock(String)

View Source
Declaration
public ScriptBlock GetBlock(string name)
Returns

ServiceStack.Script.ScriptBlock

Parameters
TypeName
System.Stringname

CreateScope(Stream)

View Source
Declaration
public ScriptScopeContext CreateScope(Stream outputStream = null)
Returns

ServiceStack.Script.ScriptScopeContext

Parameters
TypeName
System.IO.StreamoutputStream

EvaluateIfToken(Object, ScriptScopeContext)

View Source
Declaration
public object EvaluateIfToken(object value, ScriptScopeContext scope)
Returns

System.Object

Parameters
TypeName
System.Objectvalue
ServiceStack.Script.ScriptScopeContextscope

Execute()

View Source
Declaration
public PageResult Execute()
Returns

ServiceStack.Script.PageResult

Clone(SharpPage)

View Source
Declaration
public PageResult Clone(SharpPage page)
Returns

ServiceStack.Script.PageResult

Parameters
TypeName
ServiceStack.Script.SharpPagepage

Dispose()

View Source
Declaration
public void Dispose()

Implements