I am using bootstrap vertical tabs for this display. I am uploading from the FileAttachment Controller but I want to have the Attachments tab open
My question is I am using RedirectToAction to go back to the edit action view which includes the bleow but how do I redirect where the tab will be active for me?
Member
16 Points
131 Posts
Redirect to Edit action but have the attachment tab active on bootstrap tabs?
Jul 25, 2020 05:09 PM|roguenidb|LINK
I am using bootstrap vertical tabs for this display. I am uploading from the FileAttachment Controller but I want to have the Attachments tab open
My question is I am using RedirectToAction to go back to the edit action view which includes the bleow but how do I redirect where the tab will be active for me?
This is my code to my upload function
Its here i gather I would need to add the # tag to have that tab to be open ?
All-Star
52971 Points
23571 Posts
Re: Redirect to Edit action but have the attachment tab active on bootstrap tabs?
Jul 25, 2020 05:29 PM|mgebhard|LINK
The bootstrap documentation shows how to select a tab.
https://getbootstrap.com/docs/4.0/components/navs/#via-javascript
Member
16 Points
131 Posts
Re: Redirect to Edit action but have the attachment tab active on bootstrap tabs?
Jul 27, 2020 03:00 PM|roguenidb|LINK
The only issue with that approach is I would have to set a default or is the first tab always open
All-Star
52971 Points
23571 Posts
Re: Redirect to Edit action but have the attachment tab active on bootstrap tabs?
Jul 27, 2020 03:39 PM|mgebhard|LINK
Your sample code specifically sets the first tab and content as the "active" default. https://getbootstrap.com/docs/4.0/components/navs/#using-data-attributes
Add a simple "if" to check if the ViewBag.Tag is set. Of course the code depends on your requirements.