# TextControl.WebSocketHandlerPath Property

> Specifies the path to the WebSocket handler (TXWebSocketHandler.ashx). If set to null (the default value) or an empty string, the browser derives the WebSocket handler URL from the current page's URL. This property sets the portion of the path BETWEEN the web site root and the handler-ashx-file (e. g. "/foo/bar/" in case of the handler listening at ws://www.website.com/foo/bar/TXWebSocketHandler.ashx). In most cases this property doesn't need to be set and the browser generated URL works fine. However, if the web control is used in an ASP.Net MVC application and the web page containing the editor resides in a virtual directory, the WebSocket handler URL generated by the browser will be invalid. This makes it impossible for the web app to connect to the web server. Use this property to correct the WebSocket handler URL in that case. Absolute (e. g. "/editor/") and relative directories (e. g. "../../") are possible.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Assembly:** `TXTextControl.Web.dll`, which the TX Text Control .NET Server setup installs, for .NET Framework; in no NuGet package
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > TextControl.WebSocketHandlerPath Property
- **590 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/websockethandlerpath-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/websockethandlerpath-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/websockethandlerpath-property/llms-full.txt

---

### Description

Specifies the path to the WebSocket handler (TXWebSocketHandler.ashx). If set to null (the default value) or an empty string, the browser derives the WebSocket handler URL from the current page's URL. This property sets the portion of the path BETWEEN the web site root and the handler-ashx-file (e. g. "/foo/bar/" in case of the handler listening at ws://www.website.com/foo/bar/TXWebSocketHandler.ashx). In most cases this property doesn't need to be set and the browser generated URL works fine. However, if the web control is used in an ASP.Net MVC application and the web page containing the editor resides in a virtual directory, the WebSocket handler URL generated by the browser will be invalid. This makes it impossible for the web app to connect to the web server. Use this property to correct the WebSocket handler URL in that case. Absolute (e. g. "/editor/") and relative directories (e. g. "../../") are possible.

### Syntax

```csharp
public string WebSocketHandlerPath { get; set; }
```

```vbnet
Public Property WebSocketHandlerPath() As String
```

### Examples

`WebSocketHandlerPath` belonged to the older server-control surface. In the current ASP.NET Core integration, use `TextControlSettings.WebSocketURL` for the corresponding editor configuration.

```csharp
textControlSettings.WebSocketURL = "Quarterly report";
if (!string.IsNullOrWhiteSpace(textControlSettings.WebSocketURL))
{
    Console.WriteLine($"Web Socket URL: {textControlSettings.WebSocketURL}");
}
```

```vbnet
textControlSettings.WebSocketURL = "Quarterly report"
If Not String.IsNullOrWhiteSpace(textControlSettings.WebSocketURL) Then
    Console.WriteLine($"Web Socket URL: {textControlSettings.WebSocketURL}")
End If
```

---

## Nearby

- **Previous:** [TextControl.UserNames Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textcontrol/usernames-property/llms-full.txt)
- **Next:** [TextFrame Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textframe/llms-full.txt)
