Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Accessing an image on the web form

Accessing an image on the web form

Scheduled Pinned Locked Moved ASP.NET
designquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ekjon
    wrote on last edited by
    #1

    I know it's pretty basic. I have some image controls on a page. User will upload the images and the images will show up in the image controls as they are uploaded (there is a max number they can upload). I was trying to access them to see if imageurl is empty - so I can take the first control to put the image, then the second one and so on. But it's not working. Here's what I am trying: foreach (System.Web.UI.WebControls.WebControl webctrl in this.Controls) { if (typeof(webctrl) is Image) { if (webctrl.ImageUrl.Equals("") == false) { ++count; } else { img.Visible = false; } } } Any idea? Thanks.

    T 1 Reply Last reply
    0
    • E Ekjon

      I know it's pretty basic. I have some image controls on a page. User will upload the images and the images will show up in the image controls as they are uploaded (there is a max number they can upload). I was trying to access them to see if imageurl is empty - so I can take the first control to put the image, then the second one and so on. But it's not working. Here's what I am trying: foreach (System.Web.UI.WebControls.WebControl webctrl in this.Controls) { if (typeof(webctrl) is Image) { if (webctrl.ImageUrl.Equals("") == false) { ++count; } else { img.Visible = false; } } } Any idea? Thanks.

      T Offline
      T Offline
      TestRider
      wrote on last edited by
      #2

      how does it evaluates the LOC - when you try to debug the line below if (webctrl.ImageUrl.Equals("") == false)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups