ASPxClientButton.SetEnabled Method

Syntax

JavaScript

function SetEnabled(
value : bool
);

Parameters

value

Type: Boolean
true to enable the button; false to disable it.

Remarks

Use the SetEnabled method on the client to dynamically switch a button's ability to respond to end-user interactions (such as mouse hovering or clicks). The button's initial client availability state can be defined by using the ASPxButton.ClientEnabled property.

Note, the SetEnabled method result is not sent to the server side when a request is performed. This means that the disabled/enabled state is not synchronized with the server-side object. If you want to synchronize disabled states between client and server sides, for example, you can use the ASPxHiddenField control, containing the disabled state and restore it on the server side.

Note

The SetEnabled method is not in effect if a button is initially disabled on the server by setting the Enabled property to false.

Example

In this example, the ASPxProgressBar control is used to visualize the progress of a file upload initiated within the ASPxUploadControl. The ASPxClientUploadControl.UploadingProgressChanged client event of the ASPxUploadControl is handled, to supply the ASPxProgressBar control with current progress information. Using the ASPxProgressBar as a separate control, allows placing it at any desired position within the page. The complete sample project is available in the DevExpress Code Central database at E1252.