# ServerTextControl.OnXmlInvalid Method

> Raises the XmlInvalid event.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 12.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > ServerTextControl.OnXmlInvalid Method
- **503 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onxmlinvalid-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onxmlinvalid-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onxmlinvalid-method/llms-full.txt

---

### Description

Raises the XmlInvalid event.

### Syntax

```csharp
protected virtual void OnXmlInvalid(XmlErrorEventArgs e);
```

```vbnet
Protected Overridable Sub OnXmlInvalid(e As XmlErrorEventArgs)
```

### Parameters

| Parameter | Description |
|---|---|
| e | Specifies an [XmlErrorEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlerroreventargs/llms-full.txt) object that contains the event data. |

### Examples

The following example extends Server Text Control and performs custom processing when On Xml Invalid is invoked.

```csharp
class CustomServerTextControl : ServerTextControl
{
    protected override void OnXmlInvalid(XmlErrorEventArgs e)
    {
        // Add custom processing before registered event handlers run.
        base.OnXmlInvalid(e);
    }
}
```

```vbnet
Class CustomServerTextControl
    Inherits ServerTextControl

    Protected Overrides Sub OnXmlInvalid(e As XmlErrorEventArgs)
        ' Add custom processing before registered event handlers run.
        MyBase.OnXmlInvalid(e)
    End Sub
End Class
```

---

## Nearby

- **Previous:** [ServerTextControl.OnTrackedChangeDeleted Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/ontrackedchangedeleted-method/llms-full.txt)
- **Next:** [ServerTextControl.OnXmlNotWellFormed Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onxmlnotwellformed-method/llms-full.txt)
