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 36 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

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,180 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,395 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,271 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,686 Reputation points
    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.