Jun 09, 2008, 12:20 PM
Problem with TabPanel Control ActiveTab
Hello everybody,
The ActiveTab propriety does not work for me and has always the value -1.
This is my code:
Page.aspx
Thank you for help !
The ActiveTab propriety does not work for me and has always the value -1.
This is my code:
Page.aspx
<ext:TabPanel ID="tabs" runat="server" AutoPostBack="true" Title="TabPanel">
</ext:TabPanel>
Page.aspx..csprotected void Page_Load(object sender, EventArgs e){
tabs.TabWidth = Unit.Pixel(135);
tabs.EnableTabScroll = true;
tabs.AutoPostBack = true;
tabs.TabChanged += new EventHandler(tabs_TabChanged);
Tab tab1 = new Tab();
tabMytheme.AutoWidth = true;
tabMytheme.ID = "tab1";
Tab tab2 = new Tab();
tabMytheme.AutoWidth = true;
tabMytheme.ID = "tab2"; tabs.Tabs.Add(tab1);
tabs.Tabs.Add(tab2);
...
}
.....
protected void tabs_TabChanged(object sender, EventArgs e)
{
TabPanel tabpanel = (TabPanel)sender;
Tab tab = tabpanel.Tabs[tabpanel.ActiveTab]; // The tabpanel.ActiveTab has always the value -1
string idProgramme = tab.ID;
...
}
Thank you for help !