Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

RenderToStringResult Class

Definition

Namespace:
Microsoft.AspNetCore.SpaServices.Prerendering
Assembly:
Microsoft.AspNetCore.SpaServices.dll
Package:
Microsoft.AspNetCore.SpaServices v2.0.0
Package:
Microsoft.AspNetCore.SpaServices v2.1.0
Package:
Microsoft.AspNetCore.SpaServices v2.2.0
Package:
Microsoft.AspNetCore.SpaServices v3.0.3
Package:
Microsoft.AspNetCore.SpaServices v3.1.18
Source:
RenderToStringResult.cs
Source:
RenderToStringResult.cs
Source:
RenderToStringResult.cs
Source:
RenderToStringResult.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Caution

Use Microsoft.AspNetCore.SpaServices.Extensions

Describes the prerendering result returned by JavaScript code.

public ref class RenderToStringResult
public class RenderToStringResult
[System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
public class RenderToStringResult
type RenderToStringResult = class
[<System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")>]
type RenderToStringResult = class
Public Class RenderToStringResult
Inheritance
RenderToStringResult
Attributes

Constructors

Name Description
RenderToStringResult()

Properties

Name Description
Globals

If set, specifies JSON-serializable data that should be added as a set of global JavaScript variables in the document. This can be used to transfer arbitrary data from server-side prerendering code to client-side code (for example, to transfer the state of a Redux store).

Html

The HTML generated by the prerendering logic.

RedirectUrl

If set, specifies that instead of rendering HTML, the response should be an HTTP redirection to this URL. This can be used if the prerendering code determines that the requested URL would lead to a redirection according to the SPA's routing configuration.

StatusCode

If set, specifies the HTTP status code that should be sent back with the server response.

Methods

Name Description
CreateGlobalsAssignmentScript()

Constructs a block of JavaScript code that assigns data from the Globals property to the global namespace.

Applies to


Feedback

Was this page helpful?