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:18:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/05/2006 10:28:58
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:
01125673
Views:
21
This message has been marked as the solution to the initial question of the thread.
>>That's not a bug. ImageMap inherits from Image (and all objects inherit from object).
>>
>>System.Web.UI.WebControls.Image
>> System.Web.UI.WebControls.ImageMap
>>
>>That means ImageMap is Image (and it's also of type object).
>>You can check if it's Image and not ImageMap (and ImageButton which is another in the namespace hierarchy). Or alternatively you can check:
>>
>>if ( loControl.GetType() == System.Web.UI.WebControls.Image )
>>
>
>This line is the equivalent of what I have presently. I need a mechanism to identify if it's an image map. If it is, I need to execute a specific piece of code. If it's an image, it would be something else. Presently, what I do, is to verify for the image map first. If it is, I stop the execution of code. This is not really what I want. I need a way to identify this type and make sure it won't execute the code of type image. Maybe I need to create one condition for Image. Then, inside of it I would add one sub condition to verify for ImapeMap. Otherwise, it would execute the code for a standard image.

Michel,
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:
Module istest
Sub Main()
Dim str As string = "Hello"
Dim test As object = 2

MsgBox("TypeOf str Is string? " & TypeOf str Is System.String)
MsgBox("TypeOf str Is object? " & TypeOf str Is System.Object)

MsgBox("TypeOf test Is integer? " & TypeOf test Is System.Int32)
MsgBox("TypeOf test Is object? " & TypeOf test Is System.Object)


Dim type_1 as System.Type = System.Type.GetType("System.String")
Dim type_2 as System.Type = System.Type.GetType("System.Object")
Dim type_3 as System.Type = System.Type.GetType("System.Int32")

Dim type1 as System.Type = str.GetType()
Dim type2 as System.Type = test.GetType()

if ( type1.Equals( type_1) )
   MsgBox( "str is string")
end if 

if ( type1.Equals( type_2) )
   MsgBox( "str is object")
end if

if ( type2.Equals( type_2) )
   MsgBox( "test is object")
end if 

if ( type2.Equals( type_3) )
   MsgBox( "test is integer")
end if

end sub
end module
PS: VB coding sounded to be rocket science to me:)
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