Implicit Conversion with Declarative syntax

Discussion in 'ASP .Net' started by drop, Sep 13, 2007.

  1. drop

    drop Guest

    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
    drop, Sep 13, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jacob
    Replies:
    7
    Views:
    406
    Dale King
    Oct 3, 2003
  2. dmoos AT esigma-systems DOT de

    implicit vs. explicit type conversion for string vs. (char *)

    dmoos AT esigma-systems DOT de, Jun 26, 2003, in forum: C++
    Replies:
    2
    Views:
    2,502
    Default User
    Jun 26, 2003
  3. Nathan Sokalski
    Replies:
    0
    Views:
    285
    Nathan Sokalski
    Apr 2, 2008
  4. muler

    C++ declarative syntax

    muler, Apr 12, 2011, in forum: C++
    Replies:
    3
    Views:
    270
    Victor Bazarov
    Apr 12, 2011
  5. muler

    C++ declarative syntax

    muler, Apr 12, 2011, in forum: C++
    Replies:
    2
    Views:
    258
    muler
    Apr 12, 2011
Loading...

Share This Page