473,395 Members | 1,629 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.

Referencing root document in <IMG> tag...

I have a subdirectory with an aspx page that references a master file
located in the root.

In the master file template I reference a logo/image that is in
<root>/resources...
<img alt="logo" src="./resources/logo.png" />

For some reason when I pull up the page in the subdirectory it only shows
the alt tag because i think it can't find the png. Any idea why?

Other references used in the master file template are ok, such as...
<asp:Hyperlink runat="server"
NavigateUrl="./register.aspx">Register</asp:Hyperlink>

It finds the register.aspx in the <rootof the website.

Can you help me? Thanks!
Sep 21 '08 #1
2 1655
On Sep 21, 4:48*am, "Bobby Edward" <bo...@nobody.comwrote:
I have a subdirectory with an aspx page that references a master file
located in the root.

In the master file template I reference a logo/image that is in
<root>/resources...
<img alt="logo" src="./resources/logo.png" />

For some reason when I pull up the page in the subdirectory it only shows
the alt tag because i think it can't find the png. *Any idea why?

Other references used in the master file template are ok, such as...
<asp:Hyperlink runat="server"
NavigateUrl="./register.aspx">Register</asp:Hyperlink>

It finds the register.aspx in the <rootof the website.

Can you help me? *Thanks!
Because Hyperlink is a server control, and img is an html tag. Calling
this

<img alt="logo" src="./resources/logo.png" />

from the http://root/subdir/page.aspx would call an image from
http://root/subdir/resources/logo.png

If your master is always in the root, there is no reason to use "." in
the url.

Use this

<img alt="logo" src="/resources/logo.png" />

to tell to all content pages that the image location is in the <root>/
resources

Hope this helps
Sep 21 '08 #2
Thanks Alexey!
Sep 21 '08 #3

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

Similar topics

15
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*"...
5
by: MyndPhlyp | last post by:
I've been busting my head trying to figure this out for quite some time. With IE6 and NS7, no problems. I can simply code the HTML <img height="100%"> and be done with it. But NS4 and NS6 (and...
7
by: Zhang Weiwu | last post by:
Hello. This is problem puzzled me a long time. I wish to organize some block elements and let them flow one after each other like text. Think about a album, I wish the album have 12 thumbnails,...
15
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width:...
1
by: sklett | last post by:
Hi- I am using an <img> tag in a DataList. Here is the code: <img src='~/Images/<%# DataBinder.Eval(Container.DataItem, "Img")%>' runat="server"> This results in: " />
3
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the...
1
by: Carl | last post by:
Hi all I have a javascript function that drags and drops an element (ie img) into a container (ie bordered div). The function works and returns the element and and container. My next step is to...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
4
by: Jon Slaughter | last post by:
I have a captcha system going and for some reason when I use <?php $s = ""; for($i = 0; $i < 10; $i++) { $s = $s.rand(0,9); } $_SESSION = $s; $fn = '/Login/Register/Captcha.php'; echo '<img...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.