Hi Avinash,
In .NET 8,
you need to add the Interactive render mode, which is common for all Blazor
components. Every component in a Blazor web app adopts a render mode to
determine the hosting model it uses, where it is rendered, and whether or not
it is interactive. Please refer to the link below.
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#render-modes
To resolve
this on your end, please add the InteractiveServer namespace in the component
razor page. Please refer to the below code snippet.
|
@* desired
render mode define here *@
@rendermode InteractiveServer
<SfButton
@onclick="OnToggleClick" IsToggle="true"
IsPrimary="true" Content="@Content"></SfButton>
<div>@_message</div>
@code {
string _message = "Waiting for
Button Click...";
public string Content = "Play";
private void OnToggleClick(MouseEventArgs
args)
{
_message = "Button is
clicked";
Content = Content == "Play"
? "Pause" : "Play";
}
}
|
Ug Link: https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app
Please let
us know if you need any further assistance on this.
Regards,
KeerthiKaran
K V