Relative paths in IIS 7 web applications under website

Is there a way to get the Outlines in a web application under the web site to allow the actual paths in the app, not the site?

I'm a newbie, so I can't upload an image of what I'm saying, but see if you can visualize my IIS setup:

IIS 7.0
----MAIN WEB SITE:
    ----Web App #1
    ----Web App #2

Each web application has its own CSS, pointing to its own images; for example, in web application No. 1:

background-image: url(images/someimage.png)

The problem is that since the web application is installed under the main site, "images / someimage.png" is allowed to the folder with images of the main site, and not web application No. 1.

How can i fix this?

+4
source share
2

- "" Asp.net

UPDATE ( ):

, MapPath ( "~/..." ), HTML/CSS

, HTML

<img src="/images/x.jpg" />  this will work only from  

IIS 7.0
----MAIN WEB SITE

"/" "" " "

IIS 7.0
----MAIN WEB SITE
    ----Web App #1

"/" , <img src="images/x.jpg" /> , -

CSS , , , , , .

, expample

IIS 7.0
----MAIN WEB SITE:
    ----Web App #1
        ----styles
        ----images

CSS

background-image: url(images/someimage.png)

MAIN WEB SITE/Web App #1/styles/images/someimage.png

"/" background-image: url(/images/someimage.png)

MAIN WEB SITE/images/someimage.png

"../" background-image: url(../images/someimage.png)

MAIN WEB SITE/Web App #1/images/someimage.png

(, , , )

, , , -, , -,

IIS 7.0
----MAIN WEB SITE (web app #1):
    ----styles
    ----images

[, , , - , firefox/chrome F12 ]

+4

"runat =" server "". :

<a href="~/Default.aspx" runat="server">Home</a>
0

All Articles