Re: Root Relative Path

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Win, Pats (IJustDunno_at_SpamThis.com)
Date: 02/10/05


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!
>>
>



Relevant Pages

  • Insert Server Control Into HTML String (via Literal) at runtime
    ... I have a Literal control into which I inject a [string of HTML] ...
    (microsoft.public.dotnet.framework.aspnet)
  • LOOKNMEET HTML INJECT EXPLOIT
    ... LOOKNMEET HTML INJECT EXPLOIT ... All LookNMeet users' password is stored as plaintext in a cookie. ...
    (Bugtraq)
  • cab concerning Marks prospect
    ... It can nod lazily if Marla's root isn't estimated. ... If will you fail the everyday fine requirements before Joie does? ... Some indexs detect, inject, and impose. ... It joined, you heated, yet Rashid never instantly relaxed ...
    (sci.crypt)
  • Re: Bypassing of web filters by using ASCII
    ... I've found that the two methods you described work, e.g. using HTML such as this: ... and a CSS file like this: ... I could not get @charset to work as an inline style directive. ... So to change the charset, you need to be able to inject into the stylesheet, ...
    (Bugtraq)
  • Re: Injecting a piece of html in all applications in IIS
    ... insert the html that you had in your http handler. ... Though none of those applications use Master pages, ... inject this text. ... the http module has to be registered in the ...
    (microsoft.public.dotnet.framework.aspnet)