Hey,
I believe the tabcontainer has an SelectedIndex or ActiveIndex property, or something similar, which contains the index of the active tab.
Hey,
I believe the tabcontainer has an SelectedIndex or ActiveIndex property, or something similar, which contains the index of the active tab.
I have a customer that wants the Tab Control to have specific colors for the tabs depending on which tab is clicked. I have been able to use the CssClass to get the hover to be the way they would like but the active tab they would like it to be a different color.
I have attempted to write VB behind code as follows
sub onTabChange(byval sender as object, byval e as system.eventargs)
Select Case TabContainer1.ActiveTab
Case 1
TabContainer1.CssClass = "ajax__tab_tab1"
Case 2
......
end sub
I have the Sub as the onActiveTabChange property of the tab control. I do not get any debugging stop in the code behind page or any indication that there is a call to the sub from the control.
I just need a way to change the colors on each tab depending on which tab is active.
Hi,
Please make sure the AutoPostBack property of the Tab control is set to true.
If this doesn't work, please post a stripped version of your page here.
The autopostback property was the resolution
Thank you.
Ok, Here's the situation.
I've made a crm with a relations section. on the relation section there are always 4 tabs. but depending on the connection links with other relations there can be added more
so i have to add the tabs programmaticly. this is no problem. but on the first tab there is a detailsview where i edit the relation details. This all works perfectly. I can see the extra tabs and it all looks nice but the problem is when i try to edit the first tab
when i programaticly add the tabs for the relations the edit function on the first tab doesnt work anymore. I also tried only adding one tab. and that doesnt works also. Any ideas?
Error:
Specified argument was out of the range of valid values.
Parameter name: index
If (Request.QueryString("action") = 2)Then
FormView1.ChangeMode(FormViewMode.Insert)
tab3.Enabled =False
tab4.Enabled =False
tab5.Enabled =False
Else
If IsPostBackThen
Else
Dim tempTabAs AjaxControlToolkit.TabPanel =New AjaxControlToolkit.TabPanel
tempTab.ID ="tab6"
tempTab.HeaderText ="temptab"
ajaxtab.Controls.Add(tempTab)
EndIfEndSub
System.ArgumentOutOfRangeException was unhandled by user code-------
It doesnt even come past the ispostback on the edit button click
ok got it.. needs to be on page_oninit
ajax TabControl,ajax