4

TabContainerのタブをプログラムで選択するにはどうすればよいですか?また、選択したタブを取得するにはどうすればよいですか?

4

3 に答える 3

3

次のようにタブインデックスを設定できます...

tbcName.ActiveTabIndex = 3;

同様に

tbcName.ActiveTabIndex// Return active tab index

タブ インデックスの開始位置に注意してください。0

于 2011-07-26T15:35:36.390 に答える
1

hereTabContainerから取得した のプロパティの完全なリストを次に示します。

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());

AjaxControlToolkit の TabContainer コントロールを操作するための 3 つのヒント

于 2011-07-26T15:31:52.827 に答える
1
yourTabContainer.ActiveTab = tabIndex;
于 2011-07-26T15:32:07.927 に答える