简体   繁体   English

如何在asp.net网站项目中引用基本文件夹?

[英]how to reference the base folder in a asp.net website project?

My urls when I run the asp.net website project (in vs.net 2008) looks like: 当我运行asp.net网站项目(在vs.net 2008中)时,我的网址看起来像:

http://localhost:54269/www/Default.aspx

So referencing things like: 因此,引用如下内容:

/sytle/css.css

Doesn't seem to work. 似乎不起作用。

Why does my project have a '/www' folder? 为什么我的项目有一个“ / www”文件夹? Did I set things up wrong? 我把事情设置错了吗?

This might be the virtual directory. 这可能是虚拟目录。 Depending on where you are hosting your application (IIS or running in Visual Studio's built in web server) this is setup differently. 根据您托管应用程序的位置(IIS或在Visual Studio的内置Web服务器中运行),此设置有所不同。 In order to avoid problems referencing static files you could use: 为了避免引用静态文件时出现问题,可以使用:

<%= Page.ResolveClientURL("~/sytle/css.css") %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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