Skip to main content
Tab

TabPage(String, String, String) Constructor

Initializes a new instance of the TabPage class with the specified settings.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public TabPage(
    string text,
    string name,
    string imageUrl
)

Parameters

Name Type Description
text String

A String value specifying the page’s display text. Initializes the page’s TabBase.Text property.

name String

A String value specifying the name which indentifies the created tab page. Initializes the tab page’s TabBase.Name property.

imageUrl String

A String value specifying the path to the image displayed by the tab page. Initializes the ImagePropertiesBase.Url property of the tab page’s TabBase.TabImage.

Remarks

Use this constructor to initialize a new instance of a TabPage class using the settings passed via the parameters.

Example

<script runat="server">
    protected void Page_Load(object sender, EventArgs e) {
        if (!IsPostBack) {
            TabPage tab1 = new TabPage("Canada", "canada", "~/Images/Canada.png");
            TabPage tab2 = new TabPage("USA", "usa", "~/Images/USA.png");
            TabPage tab3 = new TabPage("Mexico", "mexico", "~/Images/Mexico.png");

            ASPxPageControl1.TabPages.Add(tab1);
            ASPxPageControl1.TabPages.Add(tab2);
            ASPxPageControl1.TabPages.Add(tab3);
        }
    }
    protected void ASPxPageControl1_ActiveTabChanged(object source, TabControlEventArgs e) {
        string name = e.Tab.Name;
    }
</script>
...
        <dxtc:ASPxPageControl ID="ASPxPageControl1" 
            EnableHierarchyRecreation="true" runat="server" AutoPostBack="True" 
            onactivetabchanged="ASPxPageControl2_ActiveTabChanged">
        </dxtc:ASPxPageControl>
...
See Also