开发者

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:

http://localhos开发者_运维技巧t:54269/www/Default.aspx

So referencing things like:

/sytle/css.css

Doesn't seem to work.

Why does my project have a '/www' folder? 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. In order to avoid problems referencing static files you could use:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜