究其原因其实是css文件压缩了以后,页面不能识别了
其实一般只需要用到 bootstrap.css 和 site.css
修改 Global.asax
void Application_Start(object sender, EventArgs e)
{
// 默认情况下,启用优化,将捆绑和最小化脚本和样式文件
// 为了在发布时不压缩 CSS,应该在这里禁用它
BundleTable.EnableOptimizations = false;
修改 BundleConfig.cs
public class BundleConfig
{
// For more information on Bundling, visit https://go.microsoft.com/fwlink/?LinkID=303951
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/Content").Include(
"~/Content/bootstrap.css",
"~/Content/Site.css"));
修改 Bundle.config
<?xml version="1.0" encoding="utf-8" ?>
<bundles version="1.0">
<styleBundle path="~/Content/css">
<include path="~/Content/bootstrap.css" />
<include path="~/Content/Site.css" />
</styleBundle>
</bundles>