In .net 8 blazor webapp i am using bootstrap tab to show the component data but when i try to switch to another tab instead of showing tab content it navigate me to Home page how i can fix this.

Kuldeep Y 41 Reputation points
2024-04-05T06:49:43.5833333+00:00

User's image

this is my main page component where i have other tabs links
below are the tab content

User's image

By default company tab is active but when try to switch factory or any other tab it tries to navigate and send me back to home page. How i can fix this please help me. any kind of help would be appreciated.

Thanks

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Blazor
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-04-05T20:41:12.72+00:00

    you will need to do detailed client side debugging.

    the state change and component re-render triggered by the onclick hander probably overwrites the dom changes made by the bootstrap javascript. also you are triggering Blazor navigation to the current page which could also be causing the issue.

    in general you should not use bootstrap javascript components with Blazor. The code can easily be rewritten to be Blazor only and only use bootstrap css.

    note: you should avoid including the bootstrap js file with Blazor or other virtual dom frameworks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.