This example demonstrates how you can manipulate a page control programmatically on the client using enhanced client-side functionality. The client-side programmatic interface is available if the EnableClientSideAPI property is set to true or if there is a handler assigned to any client-side event.
The ASPxPageControl allows a page's content to be changed dynamically on the client side by using the SetTabContentHTML method. This is demonstrated by the SetActiveTabContent function which uses the GetActiveTab method to access the currently active page. (See JS code)
The ShowActiveTabContent function displays (in a specific text area) the HTML code which represents the active page's content. The content of the active page is obtained via the GetTabContentHTML method. (See JS code)
The ActiveTabChanged function represents the hander for the ActiveTabChanged event. The event's argument contains information on the active tab which is used to synchronize the value of the dropdown editor. (See ASPX and JS code)
A specific page can be activated by using the SetActiveTab method. In this demo, each page is identified using its server-side Name property. In order to obtain a specific page by its name on the client side, the GetTabByName method is used. (See JS code, the ChangeActiveTab function)
Note that an individual client object can be referenced either directly by its ID (for instance, by using the following code: ASPxPageControl1.GetActiveTab()) or by using the Get method of a common collection for our ASPx web controls (this can be useful when our web control is contained within a UserControl or MasterPage, that is when the resulting client ID is generated by a specific NamingContainer). The GetTabControl function demonstrates how to access a client tabControl object by means of our control collection. (See JS code)