【发布时间】:2013-02-24 04:47:58
【问题描述】:
我有这个:
bundles.Add(new StyleBundle("~/Content/Styles/Default").Include("~/Content/Styles/Default/Site.css"));
它创建了这个:
<link href="/Content/Styles/Default?v=HG5hShy6_NaqI7SUDWQuc6zijexRxZooKF4ayIgK5tY1" rel="stylesheet">
现在,我在我的网络服务器上启用了目录浏览,当我单击该样式路径时,它会将我移动到一个目录,而不是一个文件!为什么?
更新:我还是没能解决这个问题,当我打开链接http://myserver/Content/Styles/Default?v=HG5hShy6_NaqI7SUDWQuc6zijexRxZooKF4ayIgK5tY1 时,我得到的只是一个文件列表(比如在 ftp 上)
【问题讨论】:
-
试试这个 bundles.Add(new StyleBundle("~/Content/Styles/Default/Site.css")
-
但是如果我想添加多个文件呢?
-
@Kundan Singh Chouhan:我刚刚尝试了您的解决方案,我从中得到的只是:
<link href="/Content/Styles/Default" rel="stylesheet">。这是怎么回事……
标签: asp.net asp.net-mvc asp.net-mvc-3