By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,069 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,069 IT Pros & Developers. It's quick & easy.

Problem displaying image from database..

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/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

"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
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

Nov 19 '05 #2

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

"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
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

Nov 19 '05 #3

P: n/a
You need a separate page to display the image.
Here's an example:
http://SteveOrr.net/articles/ImproveYourImages.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Irfan Akram" <Ir********@discussions.microsoft.com> wrote in message
news:96**********************************@microsof t.com...
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

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.