2011-07-26 15 views

回答

1

這裏是從here採取TabContainer的屬性的完整列表:

TabContainer Properties 

    ActiveTabChanged (Event) - Fired on the server side when a tab is changed after a 
postback 
    OnClientActiveTabChanged - The name of a javascript function to attach to the 
client-side tabChanged event 
    CssClass - A css class override used to define a custom look and feel for the tabs. 
See the Tabs Theming section for more details. 
    ActiveTabIndex - The first tab to show 
    Height - sets the height of the body of the tabs (does not include the TabPanel 
headers) 
    Width - sets the width of the body of the tabs 
    ScrollBars - Whether to display scrollbars (None, Horizontal, Vertical, Both, Auto) 
in the body of the TabContainer 
    TabStripPlacement - Whether to render the tabs on top of the container or below 
(Top, Bottom) 

與示例代碼有用的鏈接:

http://sandblogaspnet.blogspot.com/2009/04/setting-focus-to-particular-tab-in.html

tabContainer = tabContainer.control; 
//Retrieving the tab using the get_activeTab method/property 
var tab = tabContainer.get_activeTab(); 
var headerText = tab.get_headerText(); 
alert(headerText); 
//Another way of retrieving the tab using the get_previousTab method/property 
tab = tabContainer.getPreviousTab(); 
alert(tab.get_tabIndex()); 

3 Tips for Working with the AjaxControlToolkit's TabContainer Control

1
yourTabContainer.ActiveTab = tabIndex; 
+0

這將拋出一個錯誤不能轉換從int到AjaxControlToolkit.TabPanel – user710502

2

您可以設置的選項卡索引像...

tbcName.ActiveTabIndex = 3; 

,同樣

tbcName.ActiveTabIndex// Return active tab index 

請注意,標籤指數從0

+0

當我點擊我的提交按鈕,我在選項卡3上,在回發它仍然把我帶到第一個選項卡..我想回到選項卡上索引我選擇 – user710502

+0

選項卡控件不保留在回發標籤索引,請檢查這些鏈接http://www.codeproject.com/KB/ajax/maintaining-active-tab.aspx http://forums.asp.net /p/1300797/2548838.aspx –

相關問題