简体   繁体   中英

Bootstrap dropdown not working after deploying to azure webapps

I have an application which uses bootstrap. It works fine when I run it locally, but when I publish it to azure webapps, the dropdown is not working.

It throws the below error

Uncaught Error: Syntax error, unrecognized expression: #

Here is the code

<ul class="navbar-nav">
    <li class="nav-item">@Html.ActionLink("Home", "Index", "Home", new object { }, new { @class = "nav-link" })</li>
    <li class="nav-item">
        <a class="nav-link dropdown-toggle" href="#" id="dropdown04" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Master Data</a>
        <div class="dropdown-menu" aria-labelledby="dropdown04">
            @Html.ActionLink("Trip Types", "Index", "TripTypes", new object { }, new { @class = "dropdown-item" })
            @Html.ActionLink("Activites", "Index", "Activites", new object { }, new { @class = "dropdown-item" })
        </div>
    </li>
    <li class="nav-item">
        @Html.ActionLink("Parameters", "Index", "Parameters", new object { }, new { @class = "nav-link" })
    </li>
</ul>

The issue was because of bundling in MVC and I used the below code to turn off bundling

BundleTable.EnableOptimizations = false;

I added this line in the end of BundleConfig.cs in App_Start folder

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM