Back to Devexpress

Button

aspnetcore-400759-devextreme-based-controls-controls-button.md

latest5.3 KB
Original Source

Button

  • Sep 24, 2025
  • 2 minutes to read

Button is an interactive UI element that allows users to trigger specific actions or events within an application.

Run Demo: Button Read Tutorial

Getting Started

The Button UI Control is based on the DevExtreme Button component.

To add this control to your project, follow instructions in the following help topics:

Basic Syntax

cshtml
@(Html.DevExtreme().Button()
    .Text("Click to Test")
    .OnClick("onClick")
)

<script>
    function onClick(e) {
        DevExpress.ui.notify("The button was clicked.")
    }
</script>
cshtml
using Microsoft.AspNetCore.Mvc;

namespace ASP_NET_Core.Controllers {
    public class ButtonController : Controller {
        public IActionResult GettingStarted() {
            return View();
        }
    }
}

Built-in Capabilities and Configuration Guides

API

Server-Side API

InitializationCall the Button() method to create a Button control. This action initializes a ButtonBuilder instance. Use the instance methods to specify Button options and event handlers.OptionsFor a complete option list, see Options. For details on how to specify control options, refer to the following help topic: Specify Options.EventsFor available events, see Events. For details on how to handle events, refer to the following help topic: Handle Events and Define Callbacks.

Client-Side API

OptionsIf you need to specify the Button options dynamically on the client side, use client-side API. For a complete option list, see DevExtreme Button options.MethodsFor a list of available methods, see DevExtreme Button methods. For details on how to call methods, refer to the following help topic: Call Methods.

Accessibility

For more information on Button accessibility compliance, refer to the following help topic: Accessibility.

Demos

Run Demo: Button

See Also

Button - Online Demo