Back to Devexpress

ASPxEdit.IsValid Property

aspnet-devexpress-dot-web-dot-aspxedit-70e87461.md

latest3.8 KB
Original Source

ASPxEdit.IsValid Property

Gets or sets a value that indicates whether the editor’s value passes validation.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public virtual bool IsValid { get; set; }
vb
Public Overridable Property IsValid As Boolean

Property Value

TypeDescription
Boolean

true if the editor’s value passes validation; otherwise, false.

|

Remarks

If the ValidationSettings.EnableCustomValidation property is set to true, the IsValid property can be used to specify whether the editor’s value (ASPxEdit.Value) meets your validation criteria, and can be posted to the editor being validated.

If the entered value is not valid, you can set the IsValid property to false. In this case, the value will not be posted to the editor and a error text specified by the ASPxEdit.ErrorText property will be displayed. Or, you can correct the entered value manually by updating the editor’s value and leaving the IsValid value set to true. In this case, the corrected value will be written to the editor.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the IsValid property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-editors-create-registration-form/CS/ASPxEditorsTutorial.Step6/RegistrationForm.aspx.cs#L21

csharp
protected void signUp_Click(object sender, EventArgs e) {
    if (eMailTextBox.IsValid && Captcha.IsValid) {
        using (OleDbConnection connection = GetConnection()) {

asp-net-web-forms-editors-create-registration-form/VB/ASPxEditorsTutorial.Step6/RegistrationForm.aspx.vb#L21

vb
Protected Sub signUp_Click(ByVal sender As Object, ByVal e As EventArgs)
    If eMailTextBox.IsValid AndAlso Captcha.IsValid Then
        Using connection As OleDbConnection = GetConnection()

See Also

Validation

ErrorText

GetIsValid

SetIsValid(isValid)

GetErrorText

SetErrorText(errorText)

How to: Validate an Editor

ASPxEdit Class

ASPxEdit Members

DevExpress.Web Namespace