Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Implicit Conversion with Declarative syntax

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drop - 13 Sep 2007 20:29 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.