Image is ambiguous imported from name space or types

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using VB.net in the Page_Load Sub I'm trying to create a dynamic Navigation
control
nothing fancy, nothing tricky.

I dim some variables (below)

Dim tb As Table
Dim row As TableRow
Dim cell As TableCell
Dim img As Image
Dim lnk As HyperLink

All is well except I get a blue line under Image ( indicating something is
wrong) and when I compile the error is

'Image' is ambiguous, imported from the namespaces or types
'System.Web.UI.WebControls, System.Drawing'.

found some posting on google when searching for +"ambiguous" +"net" +"image"
that looked promicing but all were in another language
 
netmeister said:
Dim img As Image

'Image' is ambiguous, imported from the namespaces or types
'System.Web.UI.WebControls, System.Drawing'.

It's telling you that it doesn't know which Image you want to create.
There is an Image class in the System.Web.UI.WebControls namespace and
also an Image class in the System.Drawing namespace. It doesn't know
which one you mean.

You will need to fully quality which one you want with either:

Dim img As System.Web.UI.WebControls.Image

-OR-

Dim img As System.Drawing.Image


Chris
 
Back
Top