Re: Root Relative Path
From: Win, Pats (IJustDunno_at_SpamThis.com)
Date: 02/10/05
- Next message: Kevin Spencer: "Re: ASP .NET Application vs. Windows Service"
- Previous message: John Dalberg: ""Logon failed" in Crystal reports when switching to a different database server"
- In reply to: Ken Cox [Microsoft MVP]: "Re: Root Relative Path"
- Next in thread: Juan T. Llibre: "Re: Root Relative Path"
- Reply: Juan T. Llibre: "Re: Root Relative Path"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 10 Feb 2005 08:22:51 -0800
Unfortunately the tilde reference to the root doesn't help in my situation
because ASP.NET isn't resolving the path. What I'm doing is simply injecting
a string of HTML into the pages via a Literal control - so it's the browser
that needs to know where the root is...
I thought that starting a path with a '/' causes a path to be
"root-relative" according to HTML fundamentals (as used in the following
<img> tag):
<img src="/someFolder/AnotherFolder/TheGraphic.gif">
Am I incorrect about that?
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@sympatico.ca> wrote in message
news:%23R0quW3DFHA.576@TK2MSFTNGP15.phx.gbl...
> Don't forget about the tilde (~) in ASP.NET. It resolves to the root of
> your site. Therefore you can use something like
>
> "~/images/myimage.gif"
>
> from anywhere.
>
> Ken
>
> "Win, Pats" <IJustDunno@SpamThis.com> wrote in message
> news:ug9i6%230DFHA.3780@TK2MSFTNGP09.phx.gbl...
>>I have a snippet of HTML that I inject into a number of pages throughout
>>my Web site at runtime. My problem is that I'm not getting the image to
>>appear in all documents into which this snippet is injected.
>>
>> If I specify a document-relative path (e.g.,
>> src="../someFolder/AnotherFolder/TheGraphic.gif"), then it works fine,
>> but only for documents that exist at the [someFolder] level in the
>> directory structure.
>>
>> I thought I could use a root-relative path, as follows, in order for the
>> image to appear on all documents throughout my site:
>> <img src="/someFolder/AnotherFolder/TheGraphic.gif">
>>
>> But that doesn't seem to work.
>>
>> How can I specify the src attribute value in order to have the image show
>> up correctly on all documents - regardless of the documents location in
>> the site's folder hierarchy?
>>
>> Please note that I'm building one simple HTML string that is the same for
>> all pages into which it is injected - so there is no opportunity or
>> desire to inject a different string per document.
>>
>> Thanks!
>>
>
- Next message: Kevin Spencer: "Re: ASP .NET Application vs. Windows Service"
- Previous message: John Dalberg: ""Logon failed" in Crystal reports when switching to a different database server"
- In reply to: Ken Cox [Microsoft MVP]: "Re: Root Relative Path"
- Next in thread: Juan T. Llibre: "Re: Root Relative Path"
- Reply: Juan T. Llibre: "Re: Root Relative Path"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|