Back to Devexpress

ASPxEdit.AreEditorsValid(Control) Method

aspnet-devexpress-dot-web-dot-aspxedit-dot-areeditorsvalid-x28-system-dot-web-dot-ui-dot-control-x29.md

latest2.6 KB
Original Source

ASPxEdit.AreEditorsValid(Control) Method

Verifies whether visible editors with the specified settings are valid.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public static bool AreEditorsValid(
    Control container
)
vb
Public Shared Function AreEditorsValid(
    container As Control
) As Boolean

Parameters

NameTypeDescription
containerControl

A Control object that specifies the container.

|

Returns

TypeDescription
Boolean

true if visible editors are valid; otherwise, false.

|

Remarks

Note

The AreEditorsValid method does not validate editor data, it only checks the validation state of editors.

Example

csharp
protected void btnSubmit_Click(object sender, EventArgs e)
{
    if (ASPxEdit.AreEditorsValid(FormPanel)) {
        // TODO: Write data to database
        FormPanel.Visible = false;
        SuccessPanel.Visible = true;
        btnAgain.Focus();

        // Intentionally pauses server-side processing, to demonstrate the Loading Panel functionality.
        Thread.Sleep(2000);
    }
}
vb
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
    If ASPxEdit.AreEditorsValid(FormPanel) Then
        ' TODO: Write data to database
        FormPanel.Visible = False
        SuccessPanel.Visible = True
        btnAgain.Focus()

        ' Intentionally pauses server-side processing, to demonstrate the Loading Panel functionality.
        Thread.Sleep(2000)
    End If
End Sub

See Also

Validation

How to: Validate an Editor

ASPxEdit Class

ASPxEdit Members

DevExpress.Web Namespace