ASP.NET MVC4绑定与Twitter Bootstrap
发布时间:2020-12-15 19:29:11 所属栏目:asp.Net 来源:网络整理
导读:我试图使用新的捆绑功能在MVC 4与Twitter引导,它似乎在我喜欢的路径到glyphicons png文件int css get在某种程度上搞砸了。我的代码: bundles.Add(new StyleBundle("~/bundles/publiccss").Include( "~/Static/Css/bootstrap/bootstrap.css","~/Static/Css/
我试图使用新的捆绑功能在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())); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.Net分层应用程序 – 在层之间共享实体数据模型
- asp.net – 从磁条输入信号卡
- asp.net-mvc – 在ASP.NET MVC应用程序中使用Entity Framew
- 如何在ASP.NET MVC中使用通用处理程序(ASHX)?
- asp.net – 从AuthorizeAttribute Filter获取cookie
- 缓存ASP.NET HTTP Handler服务器和客户端的响应
- asp.net-mvc – MVC中的SignalR偏移Application Insights
- 将ASP.NET网站部署到服务器IIS上
- MVC 3验证 – 仅在失去焦点或提交后显示错误消息?
- asp.net-mvc – 如何在ASP.NET MVC 1.0中实现与ASP.NET MVC
推荐文章
站长推荐
热点阅读