Skip to main content
A newer version of this page is available. .
Tab

PageControlTemplateContainer.TabPage Property

Gets a page object for which the template’s content is being instantiated.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public TabPage TabPage { get; }

Property Value

Type Description
TabPage

A TabPage object representing the tabbed page whose tab is being rendered.

Remarks

Use the TabPage property to obtain the tabbed page object for which the template’s content is currently being rendered. You can use properties of the returned TabPage object to obtain certain values needed to bind the properties of the controls composing your template.

Example

The complete sample project is available in the DevExpress Code Central database at E483.

...
         <dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" 
         ActiveTabIndex="0" ClientInstanceName="pageControl">
             <TabPages>
                 <dxtc:TabPage Text="Tab 1">
                     <ContentCollection>
                         <dxw:ContentControl runat="server">
                          <dxe:ASPxCheckBox ID="ASPxCheckBox1" runat="server" Text="Show Tab 2">
                                 <ClientSideEvents CheckedChanged="function(s, e) {
                var tab = pageControl.GetTab(1);
                var isVisible = s.GetChecked();
                tab.SetVisible(isVisible);
                }" />
                             </dxe:ASPxCheckBox>
                         </dxw:ContentControl>
                     </ContentCollection>
                 </dxtc:TabPage>
                 <dxtc:TabPage ClientVisible="False" Text="Tab 2">
                     <ContentCollection>
                         <dxw:ContentControl runat="server">
                             <dxe:ASPxLabel ID="ASPxLabel1" runat="server" Text="Label on Tab 2">
                             </dxe:ASPxLabel>
                         </dxw:ContentControl>
                     </ContentCollection>
                 </dxtc:TabPage>
             </TabPages>
         </dxtc:ASPxPageControl>
...
See Also