Disabled Button
Sometimes specific buttons in an application must be temporarily disabled. To control the enabled state of the component, use the Enabled
Boolean attribute.
Enabled="false"
renders adisabled
attribute on the<button>
element. A disabled Button will fire itsOnClick
handler if the user removes thedisabled
attribute via the browser's developer console. This behavior is consistent with standard buttons. For sensitive tasks, verify the button state in theOnClick
handler and perform any other relevant checks.
The following example demonstrates how to enable and disable the Button.
<p>
<label>
<TelerikCheckBox @bind-Value="@ButtonIsEnabled" /> Toggle Button State
</label>
</p>
<TelerikButton Enabled="@ButtonIsEnabled">@ButtonText</TelerikButton>
@code {
bool ButtonIsEnabled { get; set; } = false;
string ButtonText => ButtonIsEnabled ? "Enabled Button" : "Disabled Button";
}