asp.net AJAX Advance Tips & Tricks (3) JavaScript Interaction with Tab

Source: Internet
Author: User

Objective

The tab controls in the ASP.net AJAX control Toolkit are very easy to use, and support for both the server and the client is very good. This article introduces the common interactions between tab and JavaScript through several FAQ, as well as the issues that should be noted.

1. Tabcantainer JavaScript interface

There are a lot of current tab controls, and the Altas tab control is a bit of a very rich JavaScript interface, and very easy to understand and use, generally used in the following groups:

  get_headerText//获取标题文字
  set_headerText//设置标题文字
  
   get_headerTab//获取标题Tab
  set_headerTab//设置标题Tab
  get_enabled//启用 TabPanel
  set_enabled//禁用TabPanel
 
  get_owner//获取TabPanel父容器
   set_owner//设置TabPanel父容器
  get_scrollBars//获取滚动条状态
  set_scrollBars// 设置滚动条状态
  get_tabIndex//获取TabPanel的序号
  _get_active//获取当前活动的 TabPanel
  _set_active//设置当前活动的TabPanel

All interfaces can be found in the Tabs.js file of the source code:

2. Common example A. Gets the Tabcontainer current active TabPanel

function GetActiveTab(tabControl) {
var ctrl = $find(tabControl);
var activeid = ctrl.get_activeTab().get_tabIndex();
alert(activeid);
}

B. Setting the TabPanel for Tabcontainer Current activity

function SetActiveTab(index) {
var ctrl = $find("TabContainer1");
var tabpanel = ctrl.get_tabs()[index];
ctrl.set_activeTab(tabpanel);
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.