开发者

C# MVC: using CSS from another location

I need to keep all images, css, etc in one folder structure and all code in another. I'm trying to get the src paths right and just cannot do it.

I have css in the following structure: /public/content/*.css and all project code in this: /protected/Code/... And public and开发者_运维问答 protected are in the same folder.

How do I use the public resource in the protected projects?

Cheers,


This sounds like something where you need relative path names. For instance, if you are inside folder/protected/Code and you need to access folder/public/content/main.css, you would use the path ../../public/content/main.css

Inside folder/protected/Code, .. refers to folder/protected, and ../.. refers to folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜