Implicit Conversion with Declarative syntax

D

drop

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top