Back to Devexpress

ValidationEventArgs.Value Property

aspnet-devexpress-dot-web-dot-validationeventargs.md

latest3.1 KB
Original Source

ValidationEventArgs.Value Property

Gets or sets the currently validated value.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public object Value { get; set; }
vb
Public Property Value As Object

Property Value

TypeDescription
Object

A Object representing the validated value.

|

Remarks

You can analyze the Value property to provide custom-written server-side validation of an end users input. In an event handler, test this value against any required condition(s) to check whether it’s valid.

If the entered value is not valid, you can set the ValidationEventArgs.IsValid property to false. In this case, the value will not be accepted by the validated editor. Otherwise, you may correct the entered value manually by setting the Value property and leaving the ValidationEventArgs.IsValid value set to true. In this case, the corrected value will be written to the editor being validated.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Value 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#L65

csharp
e.IsValid = e.Value != null;
if (!e.IsValid){

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

vb
If Not Page.IsCallback Then
    e.IsValid = e.Value IsNot Nothing
    If Not e.IsValid Then

See Also

How to: Implement a Custom Validation

ValidationEventArgs Class

ValidationEventArgs Members

DevExpress.Web Namespace