You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a bug in CheckBoxListFor concerning the values used after postback.
I cant get my posted values persist on the checkboxes, and I think it is because of the following inconsistency.
For the record, I have applied the fix from #30
The viewbag holds my data for the checkboxes (mind the selected = true!):
... to render everything as expected.
However if I do a submit, and my model is not validated the page is redisplayed, but this time without checked boxes while the list is populated the same way, but for some reason the 'items' parameter has a list without the selected properties set to true.
Another submit reverses this and everything is checked again... If selected is set to false the check boxes are always unchecked as expected. But I cant populate the list with some values set to true that way either (my original problem).
The text was updated successfully, but these errors were encountered:
There seems to be a bug in CheckBoxListFor concerning the values used after postback.
I cant get my posted values persist on the checkboxes, and I think it is because of the following inconsistency.
For the record, I have applied the fix from #30
The viewbag holds my data for the checkboxes (mind the selected = true!):
And the helper is using these values ...
... to render everything as expected.
However if I do a submit, and my model is not validated the page is redisplayed, but this time without checked boxes while the list is populated the same way, but for some reason the 'items' parameter has a list without the selected properties set to true.
Another submit reverses this and everything is checked again... If selected is set to false the check boxes are always unchecked as expected. But I cant populate the list with some values set to true that way either (my original problem).
The text was updated successfully, but these errors were encountered: