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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Interesting problem: Show image byte[] in web page

Interesting problem: Show image byte[] in web page

Scheduled Pinned Locked Moved ASP.NET
questionhelpdatabasesql-serversysadmin
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.
  • T Offline
    T Offline
    tantiboh
    wrote on last edited by
    #1

    I've found a number of articles that deal with the general subject, but I haven't been able to find anything that quite answers my question. I'm storing small JPG images (in binary format) in Sql Server as part of a larger record. When I pull that record, I'm also pulling the image. I can, of course, convert that binary data into an Image object; at that point, though, how do I display that Image object on the web page with the rest of the record's data? Is there a server control that facilitates this? Thanks for your help!

    M 1 Reply Last reply
    0
    • T tantiboh

      I've found a number of articles that deal with the general subject, but I haven't been able to find anything that quite answers my question. I'm storing small JPG images (in binary format) in Sql Server as part of a larger record. When I pull that record, I'm also pulling the image. I can, of course, convert that binary data into an Image object; at that point, though, how do I display that Image object on the web page with the rest of the record's data? Is there a server control that facilitates this? Thanks for your help!

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, In an ASP.NET application, you basically use the Image[^] server control or the img tag to display the image on the web page. So in this case, you'll have two options: + Save the Image object to disk, and specify the path to the image in the ImageUrl property of the Image control or the src attribute of the img element. + Specify a web page .aspx or a custom htpp handler .ashx in the ImageUrl property, and the web page or http handler is responsible for reading the image data and writing to the OutputStream of the Response object.

      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