Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4604182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:15:31+00:00 2026-05-22T00:15:31+00:00

Image img = new Image(); img.ImageUrl = images/sample1.jpg?rnd= + (new Random()).Next(); // added random

  • 0
Image img = new Image();
img.ImageUrl = "images/sample1.jpg?rnd=" + (new Random()).Next();  
    // added random for caching issue.
this.Controls.Add(img);

I get the error as

Cannot create an instance of the abstract class or interface ‘System.Drawing.Image’ —>Line 1

‘System.Drawing.Image’ does not contain a definition for ‘ImageUrl’ and no extension method ‘ImageUrl’ accepting a first argument of type ‘System.Drawing.Image’ could be found (are you missing a using directive or an assembly reference?) —> Line2

The best overloaded method match for ‘System.Web.UI.ControlCollection.Add(System.Web.UI.Control)’ has some invalid arguments —> Line3

Error 10 Argument ‘1’: cannot convert from ‘System.Drawing.Image’ to ‘System.Web.UI.Control’

Please help me to solve the error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:15:32+00:00Added an answer on May 22, 2026 at 12:15 am

    It looks like you’re trying to use the wrong Image class. Fully qualify it and it should work like you’re expecting.

      System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
        img.ImageUrl = "images/sample1.jpg?rnd=" + (new Random()).Next();  // added random for caching issue.
        this.Controls.Add(img);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the HTML given below: <ul id=thumbsPhotos> <li src=/images/1alvaston-hall-relaxing-lg.jpg onclick=updatePhoto (this.title)><img src=/images/1alvaston-hall-relaxing-sl.jpg width=56
I have the next function: function setImagesWidth(id,width) { var images = document.getElementById(id).getElementsByTagName(img); for(var i
I am reading image files in Java using java.awt.Image img = Toolkit.getDefaultToolkit().createImage(filePath); On some
When I turn an image ( <img> ) into a hyperlink (by wrapping it
I receive a list of image URLs and currently I have several hidden img
I got an image with which links to another page using <a href=...> <img
I have a string that is HTML encoded: '''&lt;img class=&quot;size-medium wp-image-113&quot;\ style=&quot;margin-left: 15px;&quot; title=&quot;su1&quot;\
I would like to add a path images/ to all img tags in my
Source: <TD> <A HREF=/home><IMG SRC=/images/home.gif></A> <IMG SRC=/images/spacer.gif> <A HREF=/search><IMG SRC=/images/search.gif></A> <IMG SRC=/images/spacer.gif> <A HREF=/help><IMG
Image a Button on your windows form that does something when being clicked. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.