Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get Twitter.Bootstrap.Mvc4.sample working in empty MVC4 project

I've installed Twitter.Bootstrap.MVC4 into an Asp.Net MVC Empty project template and when I start the application there are issues with the style sheets. It looks to me like they aren't linked in. Screen grab below.

Bootstrap.MVC4 output

And the head section is below

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/content/css?v=o7EqNjjD8FotmTy6On6adamUxH559LswOFRclfNrDPM1" rel="stylesheet"/>

       <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="/scripts/html5shiv.js"></script>
<![endif]-->


</head>
like image 526
Ryan Vice Avatar asked Dec 08 '22 13:12

Ryan Vice


2 Answers

In the BootstrapBundleConfig.cs file, there is a path error.

"~/Content/bootstrap.css" should be "~/Content/bootstrap/bootstrap.css"

bootstrap-responsive.css is also missing.

Have fun ;-)

like image 135
Tony Albutt Avatar answered Dec 11 '22 08:12

Tony Albutt


I had similar problem, this happens because when you install nuget package it installs the latest bootstrap which is now 3.0, while Twitter.Bootstrap.Mvc4.sample has configured itself for 2.x.

If you don't need 3.0, than you can download 2.x version and copy scripts and content in their respective folders.

For 3.0 move css files from ~/Content/bootstrap to ~/Content.

like image 35
Waheed Khan Avatar answered Dec 11 '22 09:12

Waheed Khan