共用方式為


Prerenderer.RenderToString 方法

定義

警告

Use Microsoft.AspNetCore.SpaServices.Extensions

在 Node.js 中叫用程式碼,以執行伺服器端預先呈現。

public:
 static System::Threading::Tasks::Task<Microsoft::AspNetCore::SpaServices::Prerendering::RenderToStringResult ^> ^ RenderToString(System::String ^ applicationBasePath, Microsoft::AspNetCore::NodeServices::INodeServices ^ nodeServices, System::Threading::CancellationToken applicationStoppingToken, Microsoft::AspNetCore::SpaServices::Prerendering::JavaScriptModuleExport ^ bootModule, System::String ^ requestAbsoluteUrl, System::String ^ requestPathAndQuery, System::Object ^ customDataParameter, int timeoutMilliseconds, System::String ^ requestPathBase);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.SpaServices.Prerendering.RenderToStringResult> RenderToString (string applicationBasePath, Microsoft.AspNetCore.NodeServices.INodeServices nodeServices, System.Threading.CancellationToken applicationStoppingToken, Microsoft.AspNetCore.SpaServices.Prerendering.JavaScriptModuleExport bootModule, string requestAbsoluteUrl, string requestPathAndQuery, object customDataParameter, int timeoutMilliseconds, string requestPathBase);
[System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.SpaServices.Prerendering.RenderToStringResult> RenderToString (string applicationBasePath, Microsoft.AspNetCore.NodeServices.INodeServices nodeServices, System.Threading.CancellationToken applicationStoppingToken, Microsoft.AspNetCore.SpaServices.Prerendering.JavaScriptModuleExport bootModule, string requestAbsoluteUrl, string requestPathAndQuery, object customDataParameter, int timeoutMilliseconds, string requestPathBase);
static member RenderToString : string * Microsoft.AspNetCore.NodeServices.INodeServices * System.Threading.CancellationToken * Microsoft.AspNetCore.SpaServices.Prerendering.JavaScriptModuleExport * string * string * obj * int * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.SpaServices.Prerendering.RenderToStringResult>
[<System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")>]
static member RenderToString : string * Microsoft.AspNetCore.NodeServices.INodeServices * System.Threading.CancellationToken * Microsoft.AspNetCore.SpaServices.Prerendering.JavaScriptModuleExport * string * string * obj * int * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.SpaServices.Prerendering.RenderToStringResult>
Public Shared Function RenderToString (applicationBasePath As String, nodeServices As INodeServices, applicationStoppingToken As CancellationToken, bootModule As JavaScriptModuleExport, requestAbsoluteUrl As String, requestPathAndQuery As String, customDataParameter As Object, timeoutMilliseconds As Integer, requestPathBase As String) As Task(Of RenderToStringResult)

參數

applicationBasePath
String

應用程式的根路徑。 這會在解析專案相對路徑時使用。

nodeServices
INodeServices

的實例 INodeServices ,將用來叫用 JavaScript 程式碼。

applicationStoppingToken
CancellationToken

表示主機應用程式停止時的權杖。

bootModule
JavaScriptModuleExport

包含預先呈現邏輯的 JavaScript 檔案路徑。

requestAbsoluteUrl
String

目前正在執行的 HTTP 要求的 URL。 這會提供給預先呈現的程式碼。

requestPathAndQuery
String

目前執行 HTTP 要求之 URL 的路徑和查詢部分。 這會提供給預先呈現的程式碼。

customDataParameter
Object

要提供給預先呈現程式碼的選擇性 JSON 可序列化參數。

timeoutMilliseconds
Int32

等候預先呈現完成的最大持續時間。

requestPathBase
String

目前執行之 HTTP 要求的 PathBase。

傳回

屬性

適用於