We help IT Professionals succeed at work.
Get Started
Troubleshooting Question

In MVC open a page on a certain tab

jwebster77
jwebster77 asked
on
36 Views
Last Modified: 2020-08-28
Hello,
I have an index page with 4 tabs.  On the fourth tab I have a link that brings me to another page(page B). On page B I would like a link or a button that brings me back to the index page with the third tab active.  How can I do that? Possibly with code that goes in page B view.  Thank you.
This is the code I have in Index:

INDEX VIEW
ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#firstTab">View All</a></li>
    <li><a data-toggle="tab" href="#secondTab">Add New</a></li>
    <li><a data-toggle="tab" href="#thirdTab">Closed Tickets</a></li>
    <li><a data-toggle="tab" href="#fourthTab">IT Tasks</a></li>
    @*<li><a data-toggle="tab" href="#fifthTab">Knowledge</a></li>*@
</ul>

<div class="tab-content">
    <div id="firstTab" class="tab-pane fade in active">@Html.Action("ViewAll")</div>
    <div id="secondTab" class="tab-pane fade in">@Html.Action("AddOrEdit")</div>
    @*<div id="secondTab" class="tab-pane fade in">@Html.Action("EditOneRecord")</div>*@
    <div id="thirdTab" class="tab-pane fade in">@Html.Action("ViewAllKnowledge")</div>
    <div id="fourthTab" class="tab-pane fade in">@Html.Action("ViewAllTasks")</div>
    @*<div id="fifthTab" class="tab-pane fade in">@Html.Action("ViewAllKnowledgeRealOne")</div>*@
</div>
Comment
Watch Question
Senior Software Engineer
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE