Using Twitter Bootstrap in an ASP.NET Project

I am trying to write my first ASP.NET website, and I really want to use Twitter bootstrap, but I am not getting the first barrier.

I downloaded the zip file from here , unzipped it and added the files to my solution and the following lines to my _LAyout.cshtml file:

<link href="@Url.Content("~/Context/bootstrap.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/bootstrap.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap-min.js")" type="text/javascript"></script> 

Here is a screenshot showing the above files in my solution:

CSS filesScripts

I am trying to create a menu bar at the top with this code, which was taken from this turorial

 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>@ViewBag.Title</title> <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script> <link href="@Url.Content("~/Context/bootstrap.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/bootstrap.min.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/bootstrap.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/bootstrap-min.js")" type="text/javascript"></script> </head> <body> <div class="topbar"> <div class="fill"> <div class="container"> <h3>Present Ideas</h3> <ul> <li>Blog</li> <li>About</li> <li>Help</li> </ul> <ul class="nav secondary-nav"> <li class="menu"> <a href="#" class="menu">Account Settings</a> <ul class="menu-dropdown"> <li>Login</li> <li>Register</li> <li class="divider"></li> <li>Logout</li> </ul> </li> </ul> </div> </div> <div class="container-fluid"> @RenderBody() </div> <footer> </footer> </div> </body> </html> 

What I get, instead of a horizontal strip:

Result - vertical bar instead of horizontal

I would appreciate any help to get started with promises being a great foundation.

+5
source share
1 answer

You are using Twitter Bootstrap 2.0, but the tutorial was written for Twitter Bootstrap 1.0, a lot of changes have been made to the markup that you must use to get the look you want.

It explains some changes to the navbar component in the change log , there are also some basic examples of how this is done now:

http://getbootstrap.com/2.3.2/getting-started.html#examples

http://getbootstrap.com/2.3.2/components.html#navbar

Also (not related to the question) you include both the reduced version and the standard css / js version, you only need to include one of them.

+9
source

All Articles