Skip to main content
A newer version of this page is available. .

EditorExtension.GetValue<T>(String, ValidationSettings, EventHandler<ValidationEventArgs>, ref Boolean) Method

Returns a specific editor’s value, which is validated based on both the passed validation settings and custom validation logic, and indicates whether the editor value is valid.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v18.2.dll

Declaration

public static T GetValue<T>(
    string name,
    ValidationSettings validationSettings,
    EventHandler<ValidationEventArgs> validationDelegate,
    ref bool isValid
)

Parameters

Name Type Description
name String

A string specifying the editor name (SettingsBase.Name).

validationSettings ValidationSettings

A ValidationSettings object containing the settings that relate to editor validation.

validationDelegate EventHandler<ValidationEventArgs>

A method to which custom validation processing is delegated.

isValid Boolean

true if the editor value is valid; otherwise, false.

Type Parameters

Name
T

Returns

Type Description
T

An object representing the editor value.

Remarks

The GetValue<T> method is in effect only for DevExpress editor extensions (i.e. EditorExtension class descendants).

Use the static GetValue<T> method to access the editor value within the controller code.

Note

In order to pass the editor value to the controller, place the editor within the <form> tag (e.g. using the Html.BeginForm Method) and then submit the form to the server.

Note that the client-side validation of user input can prevent the form from being submitted it to server unless the end-user input is valid.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetValue<T>(String, ValidationSettings, EventHandler<ValidationEventArgs>, ref Boolean) method.

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.

See Also