When using a DropDownList, ListBox, CheckBoxes, RadioButtons what data type do you suggest to hold the values?
Usually the values are 1, 2, 3, etc. It makes more sense to me and usually these are the id's of the items.
I tend to use the following:
1) When only ONE option can be selected I amke the property of type INT? (Nullable int).
This is for when no item is selected it makes more sense to me to check if it's null then 0.
And in most validation frameworks there is a null validator.
2) If MANY options can be selected then I use INT.
Then I can check for null or count the selections.
What do you think?
View Complete Post