开发者

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

开发者 https://www.devze.com 2023-01-04 04:07 出处:网络
My urls when I run the asp.net website project (in vs.net 2008) looks like: http://localhos开发者_运维技巧t:54269/www/Default.aspx

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

精彩评论

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