Skip to content
Advertisement

ASP.NET Core MVC using bootstrap cards with navigation tabs in a foreach loop with many cards

My question is, is there a possibility with ASP.NET Core MVC to put all data from my database in a foreach loop in different bootstrap cards with navigation?

I’ve already tried this and found that it works partially. But as soon as I click on a navigation tab from the second card, the tabs are only changed on the first card.

That’s my index.html:

JavaScript

And here is my small javascript file:

JavaScript

});

Card Nav Header:

enter image description here

As soon as I click on “Answer” on my card 2, my card 1 changes to the “Answer” page and not my card 2

Advertisement

Answer

Change your code like below:

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