繁体   English   中英

如何从TabCointainer(AjaxToolKit)中选择一个选项卡

[英]How to select a tab from TabCointainer (AjaxToolKit)

如何以编程方式选择TabContainer的选项卡? 以及如何获得所选标签?

您可以将标签索引设置为......

tbcName.ActiveTabIndex = 3;

和类似的

tbcName.ActiveTabIndex// Return active tab index

请注意,标签索引从0开始

下面是完整列表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());

使用AjaxControlToolkit的TabContainer控件的3个技巧

yourTabContainer.ActiveTab = tabIndex;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM