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

var img = new Image(); img.src = images/myFolder/myImage.png; The above will only load myImage.png.
Consider this code: var img = new Image(); img.onload = function() { console.log(this.width); };
Should this work? <script type=text/javascript> function load_i () { img = new Image(); img.onload
If I write something like this: var img = $(new Image()).attr('src', image.src); How can
<div> <a href=http://website/forum/f80/ThreadLink-new/ id=thread_gotonew_565407><img class=inlineimg src=http://website/forum/images/buttons/firstnew.gif alt=Go to first new post border=0 /></a> [MULTI]
I'm a bit stuck with my code: def setVenueImage(img): img = images.Image(img.read()) x, y
I'm using this on an hover image : $('.img-style').hover (function(e) { var prixPlus =
can you set the the image size of this control with css? <img style=border-width:
I have on my page image: @Ajax.ImageActionLink(Url.Content(~/Content/images/star-off.png), AddToFavourite, Добавить в избранное, img_add_to_favourite, null, new
Here's my CSS: #social #twitter { background-image: url(../img/twitter.svg); max-height: 32px; max-width: 32px; } And

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.