Back to Devexpress

ASPxEdit.Validate() Method

aspnet-devexpress-dot-web-dot-aspxedit-fbf34e44.md

latest1.8 KB
Original Source

ASPxEdit.Validate() Method

Performs the editor’s validation.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public void Validate()
vb
Public Sub 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#

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

VB.NET

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


See Also

[Validation](/AspNet/11167/components/data-editors/common-concepts/validation)

[ValidateEditorsInContainer](/AspNet/DevExpress.Web.ASPxEdit.ValidateEditorsInContainer.overloads)

[How to: Validate a Particular Editor](/AspNet/11129/components/data-editors/common-concepts/validation/examples/how-to-validate-a-particular-editor)

[ASPxEdit Class](/AspNet/DevExpress.Web.ASPxEdit)

[ASPxEdit Members](/AspNet/DevExpress.Web.ASPxEdit._members)

[DevExpress.Web Namespace](/AspNet/DevExpress.Web)