ASP.NET MVC4绑定与Twitter Bootstrap

我试图使用新的捆绑功能在MVC 4与Twitter引导,它似乎在我喜欢的路径到glyphicons png文件int css get在某种程度上搞砸了。我的代码
bundles.Add(new StyleBundle("~/bundles/publiccss").Include(
            "~/Static/Css/bootstrap/bootstrap.css","~/Static/Css/bootstrap/bootstrap-padding-top.css","~/Static/Css/bootstrap/bootstrap-responsive.css","~/Static/Css/bootstrap/docs.css"));


        bundles.Add(new ScriptBundle("~/bundles/publicjs").Include(
            "~/Static/Js/jquery-1.7.2.js","~/Static/Js/bootstrap/bootstrap.js","~/Static/Js/cookie/jquery.cookie.js"));

我没有看到任何图标按钮和类似。我在这里做错了吗?有什么建议么?

解决方法

问题很可能是css文件中的图标/图像正在使用相对路径,因此,如果您的软件包不与未分类的CSS文件存在于相同的应用程序相对路径中,它们将变为损坏的链接

我们在我们的todo列表中有css中的rebase urls,但现在,easist要做的是使你的bundle路径看起来像css目录,所以相对urls只是工作,即:

new StyleBundle("~/Static/Css/bootstrap/bundle")

更新:我们已经在1.1beta1版本中添加了对此的支持,因此,为了自动重写图像url,您可以添加一个新的ItemTransform,它会自动进行rebase。

bundles.Add(new StyleBundle("~/bundles/publiccss").Include(
            "~/Static/Css/bootstrap/bootstrap.css","~/Static/Css/bootstrap/docs.css",new CssRewriteUrlTransform()));

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...