0

I have downloaded bootstrap theme named flatly from bootswatch.com. I have set it up using instructions from How can I implement a theme from bootswatch or wrapbootstrap in an MVC 5 project?. But my bootstrap theme still not working. It gives me lots of warnings. I have copied downloaded flatly.bootstrap.css theme to Content directory and modified Bundleconfig.cs file, i have added new bundle: bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/flatly.bootstrap.css", "~/Content/site.css")); but that theme not working correctly: here is my screenshot of my website website image Who can help me with this issue? Also watch image attached:Warnings image

1
  • Clarify your problem, there is no useful information that can help to us help you. Commented Feb 17, 2018 at 16:46

2 Answers 2

4

Change your 'navbar' code code in _Layout.cshtml. You might be already using the below code -

<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("Home", "Index", "Home")</li>
                <li>@Html.ActionLink("About", "About", "Home")</li>
                <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
            </ul>
            @Html.Partial("_LoginPartial")
        </div>
    </div>
</div>

Replace it with below one from getbootstrap.com. But before that ensure that you have downloaded/installed bootstrap 4.0 (I have done it via Nuget package manager). You can add your customization on it -

<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Dropdown
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="#">Action</a>
          <a class="dropdown-item" href="#">Another action</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#">Something else here</a>
        </div>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
    <form class="form-inline my-2 my-lg-0">
      <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>
  </div>
</nav>
Sign up to request clarification or add additional context in comments.

Comments

0

You're using Bootstrap version 4 which has included breaking changes to version 3, which is what the ASP.NET template is using. You can either rollback Bootstrap 4 to 3 using the Nuget package manager or migrate it up to version 4.

2 Comments

I have rolled back Bootstrap 4 to 3 using Nuget package manager but i still receive warnings
This user had a similar problem and this fixed it for him. Your question has no details. What warnings? Have you completely emptied your browser cache and done a total refresh? <CTRL><F5>? stackoverflow.com/questions/48488214/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.