0

我正在使用 asp.net mvc4 互联网应用程序开始一个新项目。

我做的第一件事是安装一个Twitter Bootstrap for Asp.Net MVC 4 Sample通过 nuGet 调用的包。

这安装了其他两个包BootstrapTwitter Bootstrap for Asp.Net MVC 4.

当我运行应用程序时,我得到了这个

在此处输入图像描述

我在以前的项目中没有遇到过这个问题。当我安装 twitter bootstrap 时,当我构建应用程序时一切都很好。

谁能解释或建议,可能出了什么问题?

编辑1:

我有另一个项目,引导程序可以正常工作。当我在 chrome 中运行这两个项目并检查网络时,为这两个项目加载的文件是相同的。

4

1 回答 1

0

MVC4 项目的“App_start”文件夹中有一个文件 BundleConfig.cs(或特定的 BootstrapBundleConfig.cs)。

它将有这样的声明:

    // It won't look exactly like this.. 
    bundles.Add(new StyleBundle("~/Content/bootstrap/css/style").Include(
        "~/Content/bootstrap/css/bootstrap.css",
        "~/Content/bootstrap/css/bootstrap-theme.css"
        ));

现在您必须转到您的“Views/Shared/_Layout.cshtml”文件(或任何您的基本布局)并在您的 head 部分中添加以下行。

<head>
 /// Other stuff in here 

// This renders the boostrap style
@Styles.Render("~/Content/bootstrap/css/style")

 // include any overrides to bootstrap you have after the library
</head>
于 2013-10-02T01:47:24.770 回答