views:

356

answers:

2

I have five div tags(jquery tabs) in my aspx page...Inside the second div(tab) i have a button. onclick of that buttton the second div(tab) should be switched..instead of that the first tab is coming.. How can i switch the tab in code behind(Inside button onclick event)...

A: 

You can do that in the client code instead of in the code behind, but if you really need to do it on the code behind, you can pass a int number (ie: when you must show the first tab the int value must be 0).

Then with a script you show the tab with :eq(@number@).

Good luck!

Diego
A: 

The tabs function only takes 2 arguments:

$.fn.tabs = function(initial, settings)

But you're calling the function with 3 arguments:

string _tabSelected = "$(\"#tabs\").tabs('option', 'selected', 6);";

You should try the following instead:

string _tabSelected = "$(\"#tabs\").tabs(nr_of_active_tab);";

...where nr_of_active_tab should be self-explanatory.

PS: This is the correct link to your forum post over at jqueryhelp.com

Giu