Button Events
This article explains the events available in the Telerik Button for Blazor:
OnClick
The OnClick
event fires when the user clicks or taps the button.
It receives argument of type MouseEventArgs.
@result
<br />
@moreInfo
<br />
<TelerikButton OnClick="@OnClickHandler">Click me!</TelerikButton>
@code {
string result;
string moreInfo;
async Task OnClickHandler(MouseEventArgs args)
{
result = "Button was clicked at: " + DateTime.Now.ToString();
moreInfo = "Ctrl was pressed when clicked: " + args.CtrlKey;
}
}
The event is an
EventCallback
. It can be synchronous and returnvoid
, or asynchronous and returnasync Task
. Do not useasync void
.