RenderToStringResult Class
Definition
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
RenderToStringResult() |
Properties
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
CreateGlobalsAssignmentScript() |
Constructs a block of JavaScript code that assigns data from the Globals property to the global namespace. |