Skip to main content
Tab

ValidationSettings.ValidateOnLeave Property

Gets or sets a value that specifies whether validation is performed when the editor value is changed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(true)]
public bool ValidateOnLeave { get; set; }

Property Value

Type Default Description
Boolean true

true to perform validation on an editor value change; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to ValidateOnLeave
ASPxEdit
.ValidationSettings .ValidateOnLeave
EditProperties
.ValidationSettings .ValidateOnLeave

Remarks

To validate edit values on a specific action (for example, on a button click), call the client-side Validate method. To disable automatical validation when the editor’s value changes, set the ValidateOnLeave property to false.

<input type="button" value="Validate" onclick="ASPxClientControl.GetControlCollection().GetByName('tbTextBox2').Validate();" style="width: 127px;" />
<dx:ASPxTextBox ID="tbTextBox2" runat="server" ClientInstanceName="tbTextBox2" Width="170px">
    <ValidationSettings ValidateOnLeave="False">
        <RequiredField IsRequired="True" ErrorText="Field is required." />
    </ValidationSettings>
</dx:ASPxTextBox>

View Example: How to raise validation on the client

See Also