Synchronized server session
Load through the editor connection
Request a document through the WebSocket handler that already owns this editor session. The response is loaded without creating a second connection.
Session-aware loadingThe connection ID identifies this editor instance so the server can address the correct synchronized session.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Loading from WebSocketHandler
WebSocket-based loading is useful when the editor is already connected to a server-side worker and document operations should stay associated with that live session.
Key members
Load through the session
WebSocketHandler.LoadText
Read the editor connection
TXTextControl.connectionID
How it works
After textControlLoaded, the browser reads TXTextControl.connectionID. The button sends that identifier to the controller, which uses the WebSocket handler to load the document into the corresponding editor session.
This approach avoids treating the document as an unrelated HTTP payload. The session remains the source of truth for the connected editor and its server-side worker.
const connectionId = TXTextControl.connectionID;
const response = await fetch(`/document?connectionId=${connectionId}`);
TXTextControl.loadDocument(
TXTextControl.StreamType.InternalUnicodeFormat,
await response.text(),
() => console.log("Session document loaded"));
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0
Source files
See the implementation
The view, browser behavior, and controller are encapsulated in Demos/RichTextEditor/DocumentManagement/FromWebSocketHandler.