Amir Amine

Amir Amine

  • NA
  • 53
  • 756

nav tab toggle showing # in URL

Jul 7 2020 5:52 AM
The profile URL
  1. routes.MapPageRoute( "ProfileRoute""Profile/{userid}""~/Profile.aspx" );
the userid is fetched from database with the user, currently logged in. In the Profile web-form, I have the following tab panes
  1. <div class="collapse navbar-collapse justify-content-center fixed" id="collapsibleNavbar">  
  2. <ul class="nav nav-tabs" id="mainTab" role="tablist">  
  3. <li class="nav-item">  
  4. <a class="nav-link active" id="hometab" data-toggle="tab" name="home" href="#home" aria-controls="home" aria-selected="true" style="font-size: 90%; text-align:center;">Home</a>  
  5. </li>  
  6. <li class="nav-item">  
  7. <a class="nav-link" id="protab" data-toggle="tab" href="#Profile" name="profile" aria-controls="profile" aria-selected="true" style="font-size: 90%; text-align:center;">Profile</a>  
  8. </li>  
  9. </ul>  
  10. </div>  
  11. <div class="tab-content">  
  12. <div class="tab-pane container active" id="home" aria-labelledby="hometab" data-ride="tab">  
  13. ...  
  14. </div>  
  15. <div class="tab-pane container active" id="Profile" aria-labelledby="protab" data-ride="tab">  
  16. ...  
  17. </div>  
  18. </div>  
when I toggle the tab pane, the URL shows "Profile/userid/#home" or "Profile/userid/#Profile" and the tab pane does not activate. I'm working with bootstrap 4.5 in asp.net web-forms.

Answers (7)