Re: Referencing root document in <IMG> tag...
- From: Alexey Smirnov <alexey.smirnov@xxxxxxxxx>
- Date: Sun, 21 Sep 2008 01:31:28 -0700 (PDT)
On Sep 21, 4:48 am, "Bobby Edward" <bo...@xxxxxxxxxx> wrote:
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 <root> of 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
.
- Follow-Ups:
- Re: Referencing root document in <IMG> tag...
- From: Bobby Edward
- Re: Referencing root document in <IMG> tag...
- References:
- Referencing root document in <IMG> tag...
- From: Bobby Edward
- Referencing root document in <IMG> tag...
- Prev by Date: Re: Weird problem.
- Next by Date: Re: Any risks if I update my ASP.NET 2.0 application to 3.5?
- Previous by thread: Referencing root document in <IMG> tag...
- Next by thread: Re: Referencing root document in <IMG> tag...
- Index(es):
Relevant Pages
|