473,395 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem displaying image from database..

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
3 1325
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: GazK | last post by:
I have an image viewing page which resizes an image to a sensible sizebefore displaying. The user should then be able to choose "25% larger" or smaller and the resized image display. The problem I...
1
by: Rob Parker | last post by:
I posted this (with a different subjetc line) in the ms.public.access.forms newsgroup a few days ago, but haven't had a single response there. I'm hoping maybe someone here can help. Using...
1
by: Rob Parker | last post by:
I posted this with a different subject line (in two posts - I added additional info in the second) in this newsgroup a few days ago, but haven't had a single response. Hopefully, that was because...
2
by: Jeronimo Bertran | last post by:
Hello, I am using a rendering aspx page to display a database image on an Image control. When the database record is retrieved, I am saving the bitmap to a session variable for the rendering...
4
by: comp.lang.php | last post by:
'll try to explain this as clearly as possible, sorry if it's unclear. You have in your directory /foo 42 images You have in your database metadata for 30 out of those 42 images You have to...
2
by: keerthisreenu | last post by:
hai to all...!! iam working with Ms Access 2000. iam saving an image in the database. After that i want to retrive the same image from database and displaying it in the picture box. but its not...
14
by: ashraf02 | last post by:
i used a code from a website that allows you to display images. however everything works fine from storing the image to the database but it does not display the image. the following code is the...
4
by: shahidrasul | last post by:
i display a pic on picture box and then i want to display another pic after some seconds but problem is that first image is not displaying only display 2nd image 1... display first picture from...
6
by: vikidigi | last post by:
PLz Help i have some Images in DataBase in Blob field but images are displayed with a Cross (X) not the actual image MainPage.php//code # <?php # $con =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.