[英]Visual Studio's CSS Intellisense - Absolute paths & MasterPage files
I've noticed that to get CSS-Intellisense working in VS, the paths have to be relative - Is this the case? 我注意到,要使CSS-Intellisense在VS中工作,路径必须是相对的-是这种情况吗?
However, it seems 但是,看来
<link href="/resources/test.css" [...] />
is far more practical than 远比
<link href="resources/test.css" [...] />
I'm including the CSS in the master page, and don't see much good in including it as a content block, just to get the relative paths correct for each directory depth. 我将CSS包含在母版页中,并且将其作为内容块包含在内并没有什么好处,只是为了使每个目录深度的相对路径正确无误。 I've had a quick try with inline code resolving the path, but no dice there either (for Intellisense). 我已经尝试了使用内联代码解析路径的快速尝试,但是那里也没有骰子(对于Intellisense)。
I feel I'm missing something fairly simple - What's the correct approach here to have CSS Intellisense work across the pages in the app during dev, and render fine in any deployed state? 我觉得我缺少一些相当简单的东西-在开发期间让CSS Intellisense在应用程序的页面上正常工作并在任何已部署状态下都能正常显示的正确方法是什么?
Cheers. 干杯。
(Note - I'm aware that a <% if (false) { %> type hack is required for user controls) (注意-我知道用户控件需要<%if(false){%>类型hack))
I know this is an older question, but this works fine in VS2008. 我知道这是一个较旧的问题,但是在VS2008中可以正常工作。 If my memory serves me correctly it was fixed in a hotfix a while back: 如果我的记忆正确地为我服务,它会在一段时间后修复为修复程序:
alt text http://img168.imageshack.us/img168/8893/testgo.png 替代文字http://img168.imageshack.us/img168/8893/testgo.png
The other alternative ( if this isn't working for you still ) is adding a runat="server" and the tilde "~" 另一种选择(如果仍然无法解决问题)是添加runat =“ server”和波浪号“〜”
<link rel="stylesheet" runat="server" media="screen" href="~/css/styles.css" />
This worked for me. 这对我有用。 YMMV 青年汽车
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.