Saturday, March 24, 2012

Tabview control focus problem

Hi,

I have a yahoo tabview control with 3 tabs in my aspx page. If I am in the third tab and a control fires a postback, then I need the page to load with the third tab in focus. Instead it is showing the default first tab.

Any help is appreciated.

Thanks.

Hello,

Because we don't know how to code the third-party control, you may find some codes like this:

<script type="text/javascript">

var myTabs = new YAHOO.widget.TabView('demo', { activeIndex: 1 } ); // make tab at position 1 active

alert(myTabs.get('activeIndex')); // alerts 1

myTabs.set('activeIndex', 0); // make tab at index 0 active

alert(myTabs.get('activeIndex')); // alerts 0

</script>

Or

<li class="selected"><a href="#tab1"><em>Tab One Label</em></a></li>

As shown above, the red lines you see may help you, just change the index number you want.

There are more references for you:

A Simple TabView for Web Pages

http://www.codeproject.com/asp/TabView.asp

HTH


Hi could you let me know how to create tab forms in ASP.NET 2.0 without using any thirdparty tools...Thanks

0 comments:

Post a Comment