I have a Model that has a enum property with the Flags attribute.
[Flags]
public enum MyEnumType
{
None,
Standard = 1,
Extra = 2,
Special = 4
}
public class MyModel
{
public MyEnumType Value { get; set; }
}
In the html form I have this edited with checkboxes:
<input name="Value" type="checkbox" value="Standard"/>
<input name="Value" type="checkbox" value="Extra"/>
<input name="Value" type="checkbox" value="Special"/>
In the post body there can be multiple values for Value now. But how can I make a ModelBinder that automatically binds these to my flags-enum?