-1

I want to redirect to another view from a view. The view i will redirect to has tabs and once I am redirected I want tab # 3 to open/selected. Tab #3 has partial view, which will open once it is selected.

Can someone help, please. If more info is needed, I can send. Here is what I have so far.

<script>
$(function () {
$("#tabs").tabs();
<script>

This is for the button that will redirect to Index view in manage controller.

1 Answers1

0

To redirect to another page using javascript you can do it like this;

window.location.replace('Your URL to which you want to navigate goes here');

In the load method of the view where the tabs are, you can do this:

$(document).ready(function(){
    var $tabs = $('#tabs').tabs( { selected: null } );
    $tabs.tabs("select", 2);
});

Please note the 2nd argument to tabs function is a zero based index so 2 will select the 3rd tab.

If you want to pass the tab number to select in the redirect URL, you can do it as shown in this answer.

Community
  • 1
  • 1
CodingYoshi
  • 25,467
  • 4
  • 62
  • 64