aspnet-devexpress-dot-web-dot-validationsettings-31ad2ef1.md
Gets or sets a value that specifies whether validation is performed when the editor value is changed.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(true)]
public bool ValidateOnLeave { get; set; }
<DefaultValue(True)>
Public Property ValidateOnLeave As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to perform validation on an editor value change; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to ValidateOnLeave |
|---|---|
| ASPxEdit |
.ValidationSettings .ValidateOnLeave
| | EditProperties |
.ValidationSettings .ValidateOnLeave
|
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