havit / Havit.Blazor

Free Bootstrap 5 components for ASP.NET Blazor + optional enterprise-level stack for Blazor development (gRPC code-first, layered architecture, localization, auth, ...)
https://havit.blazor.eu
MIT License
463 stars 63 forks source link

[HxCheckbox] Issue with Static Rendering in Blazor Web App #835

Open TPIvan opened 1 month ago

TPIvan commented 1 month ago

When the InputCheckbox in the Login.razor page of the Blazor Web App template project is replaced with HxCheckbox, an error message is displayed upon form submission:

   The value 'on' is not valid for 'RememberMe'.

This occurs when the "Remember me" checkbox is checked and the "Log in" button is clicked. The likely cause of this issue is that HxCheckbox does not have a Value attribute set, which is necessary for binding the checkbox state to the model property. Below is a comparison of the HTML code rendered for both HxCheckbox and InputCheckbox: image

Steps to Reproduce

  1. Create a new project in Visual Studio using the Blazor Web App project template. In the wizard select Authentication Type: None, Interactive render mode: None, Interactivity location: Global.
  2. Add the Havit.Blazor.Components.Web.Bootstrap NuGet package (version 4.6.8) to the project and configure it according to the Havit Getting Started Guide.
  3. Replace the content of Home.razor with the code from the attached file Home.razor.txt (remove the .txt extension).
  4. Run the application, check the Havit checkbox, and click Submit. The aforementioned error message will be displayed.
rqx110 commented 1 month ago

it is the same problem I mentioned before. #707