0

I have one question regarding using JQuery UI tab control in the asp.net mvc view.

For example, I have three tabs, tab0, tab 1, and tab2 in one aspx page.

Tab1 lists all the products, and tab2 is a form to create a product. After I fill in all the data in tab2 and submit the form. How can I force the view to load tab2. By default, it's always have tab0 selected.

Thanks.

1 Answer 1

2

You can use some jquery to select the tab. You will have to write out this from your view and put it inside a doc ready block

$('#tabs').tabs('option', 'selected', 3);
Sign up to request clarification or add additional context in comments.

2 Comments

How to "write out this from your view" ? Do I write this in my action method after I finish inserting the product in the DB.
Well what is the action returning? A viewresult? if so you can pass in some form of viewdata flag that the view can pick up and write out the js needed/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.