View Single Post
  #6 (permalink)  
Old February 2nd, 2010, 10:39 AM
StevenF StevenF is offline
Authorized User
 
Join Date: Apr 2009
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

OK, on the bright side, I can get what I need to work to actually work.
On the less bright side - I'm confused:
The root of my application is

/JobProfilingWebApp.

Then I have the folders
/JobProfilingWebApp/Images
/JobProfilingWebApp/Styles

In the "/Images" folder I have a "keys.jpeg" file.

When I use
background-image: url(../Images/keys.jpeg); or
background-image: url(/JobProfilingWebApp/Images/keys.jpeg);

the file is displayed as the background, as I expect.

But when I use either of
background-image: url(/Images/keys.jpeg); or
background-image: url(~/Images/keys.jpeg);

I don't get the background image.

However, when I put a label on the page and use this code to check which path the url "~/Images/keys.jpeg" resolves to
Code:
        Dim Path As String
        Path = Me.ResolveUrl("~/Images/keys.jpeg")
        Label1.Text = Path
the path returned is
/JobProfilingWebApp/Images/keys.jpeg

So: "~/Images/keys.jpeg" doesn't work, even though it resolves to "/JobProfilingWebApp/Images/keys.jpeg", which, when set explicitly, actually does work?!?