Hi all,
I'd like to know if it's possible to declare an implicit type
conversion for when I use declarative Synthax in html.
For example, when I have the DropDownList, I can declatively set it's
Selected value like this : SelectedValue='<%# Bind("TaxCondition")
%>'. In this case, TaxCondition is an int, and the conversion from int
to string and string to int is made automatically.
Now, I've made my own CheckBoxList control in which I made a
Properties which enable me to give it a List<string> to set the
selected Items. The object I use returns an enum list ( List<enumX> ).
So, I'd like to know if there's a way to tell ASP to convert my
List<enumX> to List<string> and the other way around. I know I could
simply put a property in my Object so that it would do the conversion
on it's own and return a List<string>, but the implicit conversion
would be much more intuitive.
If possible also, I'd want the implicit conversion to apply only in
the case of the declarative syntax. I woulnd't want it to be available
anywhere in the code.
Thanks
Simon Picard
bruce barker - 13 Sep 2007 20:40 GMT
no. Bind always return a string, so it performs the conversion to string.
-- bruce (sqlwork.com)
> Hi all,
>
[quoted text clipped - 21 lines]
> Thanks
> Simon Picard