Skip to main content
Tab

ASPxEdit.Validate() Method

Performs the editor’s validation.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public void Validate()

Remarks

This method allows you to programmatically perform validation of the editor control.

# [ASPX](#tab/tabid-aspx)

```aspx
<dx:ASPxLabel ID="lbl" runat="server" Text="E-mail:">
</dx:ASPxLabel>
<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px">
    <ValidationSettings ValidateOnLeave="False">
        <RequiredField ErrorText="E-mail is required" IsRequired="True" />
    </ValidationSettings>
</dx:ASPxTextBox>
<dx:ASPxButton ID="btn" runat="server" Text="Submit" onclick="btn_Click" CausesValidation="False">
</dx:ASPxButton>
```
***
# [C#](#tab/tabid-csharp)

```csharp
protected void btn_Click(object sender, EventArgs e) {
    ASPxTextBox1.Validate();
}
```

# [VB.NET](#tab/tabid-vb)

```vb
Protected Sub btn_Click(ByVal sender As Object, ByVal e As EventArgs)
    ASPxTextBox1.Validate()
End Sub
```
***
See Also