Hi,
I am new using Radzen. I have created a project, added Radzen latest via NuGet package. Problem is that Radzen button's click event is not firing. It is not hitting breakpoint.
Event is defined in a component-based class(TestBase: ComponentBase).
public void SubscribeClick(MouseEventArgs args, string buttonName)
{
}
.razor code
@inherits TestBase
<RadzenButton Text="Subscribe" Click="@((args) => SubscribeClick(args, "Subscribe"))" ButtonStyle="ButtonStyle.Secondary" Style="margin-bottom: 10px;" />
Hi @SP_001,
Your code seems identical to our online demo (which works). Not sure what the problem could be.
Thanks for the response. I don't know either what's wrong. I see sample works. I am using VS 2019. Do I need to do any wiring in startup class relate to Radzen?
Thanks
No additional code is needed for the Button click event to work.
I seem to have the same issue. I have a button: <RadzenButton Click=@(args => UpdatePlaylistTitle()) Text="Save"></RadzenButton>
and it doesn't trigger the function. When I copy it into the editor at: https://blazor.radzen.com/button it works and the function is triggered. However, in my project, it is not.
UPDATE:
It seems that the render modes are an issue, not Radzen itself, because a regular blazor button didn't work as well with @onclick. I added @rendermode RenderMode.InteractiveServer
to the component and everything started to work. Reading this: Event handlers in layout do not seem to fire in a .NET 8 RC1 blazor application · Issue #50712 · dotnet/aspnetcore · GitHub gave me the idea to try that and it worked.