I want to create a filter dropdown in a .net core MVC web page to search product and add to shopping cart. when typing on the dropdown box, products should be filtered and loaded to dropdown according to entered text.
CodePudding user response:
According to your description, it seems you want to achieve filter and select the dropdownlist inside your MVC application. Actually, there is a lot of angularjs library could achieve this thing. I suggest you could refer to this live demo to check if this match your requirement.
If this matche your requirement, you could follow this article to used it inside your application.
Please notice, you should build your own logic to get the product info inside the data like below:
// get the data and set it inside the angular.js
$scope.allStates = [
{ "name": "Alabama", "id": "AL" },
{ "name": "Alaska", "id": "AK" },
...