I have two separate web applications named MainWeb and Reports. I want to deploy them this way: there would be one virtual application for MainWeb, pointed, for instance, to c:\\inetpub\\www\\mainweb .
The Reports application I would like to deploy in a subdirectory of main web, so that it is at c:\\inetpub\\www\\mainweb\\reports .
Thus I can combine the two which are logically coupled but I want to have them in separate projects for easy manipulation.
The problem is, in my Reports project I use constructs like ~/Style/Whatever.css
which works fine when running standalone Reports application but when using as subdirectory in main web, it resolves to http://localhost/Style/Whatever.css though I would need it to resolve to http://localhost/ reports /Style/Whatever.css .
So the question is, is it possible to handle this situation, maybe some way to modify the behavior of ~
in nested web.config?
并不是真正的webby家伙,但是报表中真实文件夹的快捷方式又如何呢?
hm, I have similar situation and I am not sure what's your problem, VirtualPathUtility and server control resolves ~ to current web application root.
But maybe you can put Virtual Path in Properties/Web section of your Reports application directory for localhost, picture here
There are 3 different ways I've solved this problem before:
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.