I have an int array as a property of a Web User Control. I’d like to set that property inline if possible using the following syntax:
<uc1:mycontrol runat='server' myintarray='1,2,3' />
This will fail at runtime because it will be expecting an actual int array, but a string is being passed instead. I can make myintarray a string and parse it in the setter, but I was wondering if there was a more elegant solution.
Implement a type converter, here is one, warning : quick&dirty, not for production use, etc :
and tag the property of your control :