I’ve mentioned before that I work in the Internal Tools group at my job, and because of this we end up building a lot of line-of-business apps. Basically, we build web apps that allow other people to do their job more efficiently.
Lately we’ve been having a lot of requests to build something like a CheckBoxList control from WebForms in our MVC projects. We didn’t really have any default way in MVC to handle this kind of thing, so we decided (like all good programmers) to roll our own. So, here it is, and feel free to let us know in the comments how it works for you!
The first problem we had to tackle was that we wanted our check box list control to be reusable. Because of this, we needed to think about what comprised a checkbox, and we came up with three attributes of a checkbox:
An ID
Text to display
A boolean for whether the box is checked or not
#asp.net mvc #checkboxlist