简体   繁体   中英

How to reference web.config from sub-directory

任何人都可以介意向我详细解释是否可以在子目录中引用ASP.NET应用程序的web.config文件,并且如果可以的话,您可以向我指出正确的方向吗?

It's unclear what your asking — you might want to reword the question to make clear the problem. However, in ASP.Net controls, a URL that looks like

/foo/bar/picture.jpg

is absolute and is anchored at the server root.

A URL that looks like

foo/bar/picture.jpg

is relative with respect to the current URL.

Finally, URLs that look like

~/foo/bar/picture.jpg

are anchored to the root of the current web app. You might want to take into consideration the fact that web apps can be nested .

How URLs are referenced really has nothing to do with web.config. There is, however, an search and inheritance hierarchy for config data, along with scoping rules for that data. See the documentation for details .

Find mydomain.com/folder in IIS. Right-click it and pick "Convert to application" This will tell IIS to treat /folder as its own application, instead of just another folder inside the mydomain.com application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM