473,385 Members | 1,587 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,385 software developers and data experts.

image.src

Hey

asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage I want
to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item" and add
this image, then this works.... but the images are generated dynamically in
runtime so adding them to the project isn't a good solution

Any ideas what I should do to solve this?

Jeff

Jul 3 '06 #1
5 2559
Jeff wrote:
Hey

asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage
I want to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item"
and add this image, then this works.... but the images are generated
dynamically in runtime so adding them to the project isn't a good
solution
If the images are generated dynamically in runtime, why are you
refering to them statically at compile time?

I suggest either:
1) adding a "dummy" image that is replaced at runtime with the real image
or
2) removing the static reference and setting the src property at runtime

--

Riki
Jul 3 '06 #2

"Riki" <ri**@dontnagme.comwrote in message
news:uI**************@TK2MSFTNGP02.phx.gbl...
Jeff wrote:
>Hey

asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage
I want to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item"
and add this image, then this works.... but the images are generated
dynamically in runtime so adding them to the project isn't a good
solution

If the images are generated dynamically in runtime, why are you
refering to them statically at compile time?

I suggest either:
1) adding a "dummy" image that is replaced at runtime with the real image
or
2) removing the static reference and setting the src property at runtime

--

Riki
Hmm the code I mentioned above was just an example, I've also tryed this
way:
<img ID="photo" src= "<%# Eval("File") %>"/but it gives the same error....

I wonder about your 2. suggestion:
This list of images are displayed in a Repeater control. Is it a good
solution to use the rptInbox_ItemDataBound (my repeaer control's ID =
rptInbox) event do dynamically add the image to the webpage or are there
some other event's which suits better?... Sorry if my questions sounds odd,
but I'm a newbie...

Jeff
Jul 3 '06 #3
Hey
>
asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage I want
to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item" and add
this image, then this works.... but the images are generated dynamically in
runtime so adding them to the project isn't a good solution

Any ideas what I should do to solve this?

Jeff
I take it the *browser* gives that errormessage?
What is in the html that the browser received (do a "view source").
Does the "src" still point to the directory you think it should point
at?
Reason: if the "src" attribute is processed by the asp.net environment
(as it will be when you add a runat=server attribute), then it might be
changed. When this code is in an ascx, the path is taken to be relative
to the *ascx*, not relative to the aspx it ends up in.
When this is the case, you could use "webapp-root-relative" paths, by
starting with a "~" (~/images/helloworld.jpeg). This will work wherever
the application is installed: //localhost/theApp/Web or
//www.somesite.com

Hans Kesting
Jul 3 '06 #4
Jeff wrote:
"Riki" <ri**@dontnagme.comwrote in message
news:uI**************@TK2MSFTNGP02.phx.gbl...
>Jeff wrote:
>>Hey

asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage
I want to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item"
and add this image, then this works.... but the images are generated
dynamically in runtime so adding them to the project isn't a good
solution

If the images are generated dynamically in runtime, why are you
refering to them statically at compile time?

I suggest either:
1) adding a "dummy" image that is replaced at runtime with the real
image or
2) removing the static reference and setting the src property at
runtime --

Riki

Hmm the code I mentioned above was just an example, I've also tryed
this way:
<img ID="photo" src= "<%# Eval("File") %>"/but it gives the same
error....
This should work, but you should fix the outer quotes into single quotes:
<img ID="photo" src= '<%# Eval("File") %>'/>
I wonder about your 2. suggestion:
This list of images are displayed in a Repeater control. Is it a good
solution to use the rptInbox_ItemDataBound (my repeaer control's ID =
rptInbox) event do dynamically add the image to the webpage or are
there some other event's which suits better?... Sorry if my questions
sounds odd, but I'm a newbie...
We all were newbies once... so that's no problem.
ItemDataBound is ok, but the Eval method above is the preferred one.

See also Hans' remark.

--

Riki
Jul 3 '06 #5
Thank you
"Riki" <ri**@dontnagme.comwrote in message
news:uE**************@TK2MSFTNGP02.phx.gbl...
Jeff wrote:
>"Riki" <ri**@dontnagme.comwrote in message
news:uI**************@TK2MSFTNGP02.phx.gbl...
>>Jeff wrote:
Hey

asp.net 2.0

I have a webpage which generate thumbnail images. In another webpage
I want to display these images...
I tryed using this solution:
<img ID="photo" src="../../images/helloworld.jpeg"/>
But this gives this error:
File '../../images/helloworld.jpeg' was not found

The file helloworld.jpeg exist in the ../../images/ folder.....

If I in solution explorer right click and choose "Add Existing Item"
and add this image, then this works.... but the images are generated
dynamically in runtime so adding them to the project isn't a good
solution

If the images are generated dynamically in runtime, why are you
refering to them statically at compile time?

I suggest either:
1) adding a "dummy" image that is replaced at runtime with the real
image or
2) removing the static reference and setting the src property at
runtime --

Riki

Hmm the code I mentioned above was just an example, I've also tryed
this way:
<img ID="photo" src= "<%# Eval("File") %>"/but it gives the same
error....

This should work, but you should fix the outer quotes into single quotes:
<img ID="photo" src= '<%# Eval("File") %>'/>
>I wonder about your 2. suggestion:
This list of images are displayed in a Repeater control. Is it a good
solution to use the rptInbox_ItemDataBound (my repeaer control's ID =
rptInbox) event do dynamically add the image to the webpage or are
there some other event's which suits better?... Sorry if my questions
sounds odd, but I'm a newbie...

We all were newbies once... so that's no problem.
ItemDataBound is ok, but the Eval method above is the preferred one.

See also Hans' remark.

--

Riki

Jul 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pierre Tremblay | last post by:
Hi! I am trying to display an image in my html document. The document contains the following line: <td class="Input"><img...
3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
6
by: QuasiChameleon | last post by:
Hi, I'm trying to create a grayscale image class that reads and writes grayscale Targa format. This works well with smaller images, but corrupts larger images and creates a "Segmentation fault...
15
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
6
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
1
by: bharathv6 | last post by:
i need to do is modify the image in memory like resizing the image in memory etc ... with out saving it disk as i have to return back the image with out saving it disk PIL supports the use of...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.