Button
- 3 minutes to read
The ASPxButton control allows you to implement extended button functionality. The ASPxButton’s client-side and server-side APIs allow you to customize the button’s appearance, and validate editor data without additional validation controls.
#Main Features
Radio Button Functionality
You can use the ASPxButton.Checked and ASPxButton.GroupName properties to group several buttons and use them as radio buttons. Use the ASPxButton.CheckedStyle property to customize the button’s checked state appearance. The control raises the ASPxButton.CheckedChanged event when a user checks the button. Refer to the following online demo to see the radio button functionality: Button Features.
Native Render
Set the ASPxButton.Native property to
true
to render the ASPxButton as a native HTML input element (button). This reduces the amount of generated HTML code and improves the editor’s performance. In native mode, the button’s appearance depends on how the client browser renders native HTML elements.Render Modes
The ASPxButton.RenderMode property allows you to specify how the browser renders the button.
Render Mode ASPx Button Button Render Mode. Button Button Render Mode. Danger Button Render Mode. Link Button Render Mode. Outline Button Render Mode. Secondary Built-in Validation
The ASPxButton control allows you to validate its data on the client and server sides. Refer to the following topic for more information: Validation.
Appearance Customization
Appearance
Description
Native HTML button input element
When a browser renders the ASPx
Button control as a native HTML button input element, the browser uses the native Windows style to paint the button. In this mode, the button’s appearance depends on the system settings. Apply DevExpress Themes
You can apply DevExpress themes to Dev
Express controls to ensure a consistent appearance. Refer to the following topic for more information: DevExpress Themes Overview.Button appearance properties
The ASPx
Button content can consist of text and an image in the following combinations: - Image - Displays the button as an image.
- Image and Text - Displays the button as a combination of an image and text.
- Background Image and Text. - Displays the button as a combination of a background image and text.
Client-Side API
The ASPxClientButton object (the ASPxButton control’s client-side equivalent) allows you to access the button’s client-side APIs.
Method Description ASPx Client Button. Do Click Simulates a mouse click on the button. ASPx Client Button. Focus Focuses the button. ASPx Client Button. Get Checked Specifies whether the button is checked. ASPx Client Button. Set Checked Specifies the button’s checked status. ASPx Client Button. Get Enabled Indicates whether the button is enabled. ASPx Client Button. Set Enabled Enables the button. ASPx Client Button. Get Image Url Returns the URL of the button’s image. ASPx Client Button. Set Image Url Specifies the URL of the button’s image. ASPx Client Button. Get Text Returns the button’s text. ASPx Client Button. Set Text Sets the button’s text.