Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this be interpreted as a bug?
Message
From
29/05/2006 11:43:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/05/2006 11:37:48
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01125597
Message ID:
01125680
Views:
27
>>No they are not equivalant. I tried to write some code in VB showing that they're not but my VB is simply none. Sorry for the ugly code:
>
>This is an example of how I did it:
>
>
>                ' If the control is an image
>                If TypeOf loControl Is System.Web.UI.WebControls.Image Then
>
>                    ' If the control is an imagemap
>                    If TypeOf loControl Is System.Web.UI.WebControls.ImageMap Then
>                        loControlImageMap = CType(loControl, System.Web.UI.WebControls.ImageMap)
>                        loControlImageMap.ImageUrl = oApp.cLanguage + "/" + loControlImageMap.ImageUrl
>                    Else
>                        loControlImage = CType(loControl, System.Web.UI.WebControls.Image)
>                        loControlImage.ImageUrl = oApp.cLanguage + "/" + loControlImage.ImageUrl
>                    End If
>
>                End If
>
Michel,
I think it would be better if you use GetType() instead.
For example your code would hit "else" part if that's an ImageButton ( is Image true, is ImageMap false ). If you do it like this then you need to have an if block for every derived type from Image (and for those ones that might be introduced in next version).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform