Skip to content
Advertisement

Bootstrap-select won’t drop down when clicked in ASP.NET web application

I am building an ASP.NET web application, and I am having serious trouble getting bootstrap-select to work properly.

I have looked at other posts on SO on this, and nothing seems to fix the issue, so I’m hoping I can get some help today.

The web application uses a master page, which contains the following declarations to include all of the CSS and JavaScript files:

JavaScript

In the content page I have a bootstrap-select which is intended to display a list of product categories which are retrieved using an AJAX call. The HTML for the bootstrap-select is as follows:

JavaScript

At the end of the $(document).ready(function () { script section, I have the following 2 lines of code related to the bootstrap-select:

JavaScript

The call to loadCategories() uses the following code to make an AJAX call to retrieve a list of category records from the database. Here is that code:

JavaScript

I included a call to an alert to ensure the data is being returned, and it is.

When I execute this code, here’s what I get on-screen:

Screenshot of result

I get no errors or messages in the console window, so I don’t know what the issue is, but clicking the bootstrap-select control does nothing – it doesn’t drop down, and it doesn’t show the data either. Whatever’s going on, it fails silently. I thought maybe it had to do with the order I have the Javascript and CSS files loading in the master page, and I’ve followed every example I can find, but it still doesn’t seem to work.

Any help that can be provided would be GREATLY appreciated.

Advertisement

Answer

The short answer to this is that bootstrap-select doesn’t work with Bootstrap 5. When I regressed to version 4.1.3, it now works. Hopefully this is fixed soon.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement