views:

299

answers:

1

Normally when you have items like images or css in the theme folder they get nicely parsed and the url omits the App_Themes part. However I noticed for some background images, set in the css which comes from the same theme, that a request with the App_Themes/MyTheme/someimage.gif gets done. Resulting in an obvious 404 response.

How does this happen? And more important to me: what can I do to get rid of this as it hurts my performance.

+1  A: 

Paths in CSS files are always relative to the CSS file. So if you set a background image from a CSS file (located in the theme folder) then the image URL is relative to the CSS file.

If you don't want that behaviour, then you can reference the image using "../../images/myImage.gif" or "/appName/images/myImage.gif" (assuming your image is in the "images" folder of your web app.

M4N
My question's not about the css and relative path. It is about how the App_Theme/MyTheme part gets into the request by the browser to the server while I just specify a call as background image in css to myimage.gif.
Nyla Pareska