I have a class that i uses JavaScriptSerializer.Deserialize<class>
One of the properties i get from the UI is an int (0 or 1). Is there any way to change the getter/setter on the property in c# so it understands that it should return true or false based on the value? Or do i need another property that checks the int prop? Thanks
The best way would be to create your own JavaScriptConverter which can be used to handle your object and convert between different data types. Override the serialize/deserialize methods and parse the format as you wish.
Here’s a link to a previous answer I wrote which implements the JavaScriptConverter, showing you how you’d pass it to the JavaScriptSerializer object: https://stackoverflow.com/a/4999004/298053