Image is ambiguous imported from name space or types

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
 
C

Chris Dunaway

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top