Error: 'Image' is an ambiguous reference

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

Guest

I am trying to execute the following code...

((Image)e.Item.FindControl("imgStatus"))

.... i get the error: "'Image' is an ambiguous reference".

My question is: How am i to convert the "e.Item.FindControl" to an Image
control?

Thanks?
 
charliewest said:
I am trying to execute the following code...

((Image)e.Item.FindControl("imgStatus"))

... i get the error: "'Image' is an ambiguous reference".

My question is: How am i to convert the "e.Item.FindControl" to an Image
control?

((System.Web.UI.WebControls.Image)e.Item.FindControl("imgStatus"))
 
Hi,

This happen when you include two namespaces that define the same class, in
your case both System.Drawing and System.Web.UI.WebControls namespace define
a Image class,
just use the FQN .

cheers,
 
Hi,

Regarding the inclusion of System.Drawing, I have no idea why it's
included by default
I just comment it out on all the pages of a project and nowhere was I using
it.

Anybody knows why it's included in the first place?


cheers,
 
Back
Top