1

is there was a way of making a checkbox editor template or html helper for a Byte MVC model property? Someone else did ask basically the same thing here, Display a byte as a checkbox using a EditorTemplate?, whose solution I may end up using; furthermore, it links to somewhat related Checkbox for nullable boolean. However, neither of these actually establish a working editor template/helper, so while I would assume that means I'm going to have to settle the matter somewhat unconventionally, I just wanted to double-check.

Community
  • 1
  • 1
Bondolin
  • 2,793
  • 7
  • 34
  • 62

1 Answers1

0

You can use an EditorTemplate and a custom model binder for the byte type and checking in the binder if the type is boolean to return 1 or 0

Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206