<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
tabContainer = tabContainer.control;
Below I have listed some of the important javscript functions which may be of use for developers like us. These methods can be used only after one has retrieved the ASP.NET AJAX TabContainer control using the following code “TABCONTAINER_CONTROL.control” as shown in the above codes.
gets the active tab index. The function returns an integer value of the active tab.
|get_id()||gets the id of the tab container control.|
returns a boolean value indicating whether the tab container is visible or not.
|getFirstTab()||gets the first tab in the tab container control. The function returns a tab having tab index 0.|
|getLastTab()||gets the last tab in the tab container control. The function returns a tab object having tab index = (tab count) –1.|
gets the nearest tab. If the current tab index is 0 then the method will return second tab i.e. the tab having tab index as 1 and if the tab index is greater than 0 the function will return the previous tab i.e. the tab having index = [Current Tab Index] – 1.
gets the next tab in the tab container control i.e. if the current active tab is the last tab then the function will return the first tab as the next tab else it will return the next tab ([Current Tab Index] + 1)
gets the previous tab in the tab container control i.e. if the current tab index is 0 then the function returns the last tab else it returns the previous tab ([Current Tab Index] - 1)
sets the active tab. The function takes a tab object as its argument and sets the tab as the active tab.
functions takes an integer value starting from 0 to tab collection length – 1 as an argument and sets the tab’ index matching the integer value as the active tab.
sets the id for the current tab container control.
function takes a Boolean value and based on the value, hides or shows the tab container. The function/property makes the whole tab container control visible or invisible. To make individual tabs visible or invisible you need to work with the tabs property as shown in the below table.
The above functions are related to the tab container control. There may situation where one might want to work with individual tab objects. To work with individual tabs one has to retrieve the individual tab by making us of any of the above tab retrieval functions from the table and then one can work with the individual tab. Sample e.g to retrieve individual tab is given below.
tabContainer = tabContainer.control;
Once you have retrieved the individual tab using any of the above methods you can make use of some of the useful methods listed in the table below to work with the tab object. The methods listed in the below table are not the complete list but they are some of the methods which I feel may be useful for developers.
gets a Boolean value indicating whether the tab is enabled or not (disabled). The function returns true or false.
gets the header text of the tab. The function returns string containing the header text.
|get_id()||gets the id of the tab.|
|get_tabIndex()||gets the tab index of the tab object. The function returns an integer.|
|get_visible()||gets whether the tab is visible or not. The function returns a boolean value.|
removes the CSS class based on the class name passed in the argument.
enables or disables the tab object based on the boolean value passed.
function sets the header text for tab. Functions takes a string as an argument and sets the string as the header text.
|set_id()||sets the id for the tab.|
sets the visibility of the tab based on the boolean argument passed. The boolean value makes the tab visible or invisible.
In my next blog we will see the difference between $find and $get. Till then try to know more.