New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Defines the fluent API for configuring the Kendo UI Button for ASP.NET MVC events.

Definition

Constructors

Initializes a new instance of the ButtonEventBuilder class.

C#
public ButtonEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

The Button event handlers.

Methods

Defines the handler of the Click client-side event. Fires when the Button is clicked with the mouse, touched on a touch device, or ENTER (or SPACE) is pressed while the Button is focused.

C#
public ButtonEventBuilder Click(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ButtonEventBuilder

Returns the current instance of ButtonEventBuilder .

Example:
C#
@( Html.Kendo().Button()
.Name("Button")
.Events(e =&gt; e.Click(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Defines the handler of the Click client-side event. Fires when the Button is clicked with the mouse, touched on a touch device, or ENTER (or SPACE) is pressed while the Button is focused.

C#
public ButtonEventBuilder Click(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the Click event.

Returns:

ButtonEventBuilder

Returns the current instance of ButtonEventBuilder .

Example:
C#
@( Html.Kendo().Button()
.Name("Button")
.Events(events =&gt; events
.Click("onClick")
)
)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Button is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ButtonEventBuilder KendoKeydown(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ButtonEventBuilder

Returns the current instance of ButtonEventBuilder .

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the Button is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ButtonEventBuilder KendoKeydown(string handler)
Parameters:handlerstring

The name of the JavaScript function that will handle the KendoKeydown event.

Returns:

ButtonEventBuilder

Returns the current instance of ButtonEventBuilder .