How to set the disabled state in Blazor Button
27 Aug 20261 minute to read
The Blazor Button component can be enabled or disabled by setting the Disabled property. To disable the Blazor Button component, set the Disabled property to true. The property is rendered as the standard HTML disabled attribute on the underlying button element.
The following example demonstrates a Blazor Button in the disabled state and a second Button that enables it on click.
@using Syncfusion.Blazor.Buttons
<SfButton Disabled="@disable" @ref="ButtonObj">Disabled</SfButton>
<SfButton OnClick="click">Enable</SfButton>
@code {
SfButton ButtonObj;
private bool disable = true;
public void click()
{
disable = false;
}
}