Skip to content

Blazor (ASP.NET Core Hosted) On Blazor full page post back, checked checkboxes values are sent as 'on' and not as 'true'. #10118

@rxelizondo

Description

@rxelizondo

Describe the bug

When posting using "old fashion" full page post back from a Blazor page, checkbox values that are checked are sent to the server as “on” instead of “true”. This is causing the server-side controller action binding functionality to not work correctly. Here is an example of what is being sent:

------WebKitFormBoundaryDfOPWAOmQ7LSeLuf
Content-Disposition: form-data; name="SomeCollection[2].IsMember"

on
------WebKitFormBoundaryDfOPWAOmQ7LSeLuf

As far as I can tell, when doing the same thing from pages generated via ASP.NET Core MVC the checked checkbox values are sent as “true” which works fine with model binding on the server-side.

I get that I should not be using old fashion full page post backs with Blazor pages and I don’t, however, I am porting an old ASP.NET Core MVC into Blazor and for this particular page and for the time being, I would like to keep using old fashion full page post back (at least for now).

Why did you guys change check box values being sent to the server from "true" to "on"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions