Problem displaying image from database..

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

Guest

Hi Guys,

I am having problems displaying an image from the database, that alreday has
been uoploaded successfully.

The image loads in correctly, but by default it is displayed on the whole
page. I want it to bde displayed on some part of the page. I was able to do
that if I used img.ImageUrl, for images stored on my hard drive, but I want
to view it from anywhere my site is sccessed, hence I decided to get it
loaded directly from database.

How can I load the image on a section of the page e.g. in a div, rather than
on the whole page

<DIV style="OVERFLOW: scroll; WIDTH: 872px; HEIGHT: 299px"><img id="imgPage"
runat="server"></DIV>

Please help...

Thanks,

I..A
 
The standard solution is to a have a special web page, called, for example,
GetImage.aspx. Your image url will point to the page:

ImageUrl="GetImage.aspx?id=myImageId"

The page will find the image in the database according to id and stream it
down to the client in the response stream.

Eliyahu
 
Search the MSDN for their DynamicImage control. It can render images based
on URL, file or a byte[] array.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top