I have a custom object called S2kBool that can be converted to and from a regular Boolean object. Basically, it allows my application to treat boolean values in my legacy database the same way it treats C# booleans. Then problem is, when I attempt to use a check box to set the value of an S2kBool property, it fails.
Code like this works:
public class MyClass {
public S2kBool MyProperty { get; set; }
}
MyClassInstance.MyProperty = true;
But it's almost like UpdateModel is expecting an actual bool type, rather than an object that can be converted to a bool. I can't really tell, however, since the exception thrown is so vague:
The model was not successfully updated.
How can I get around this? Do I need a custom ModelBinder?
Thanks!