Monday, March 26, 2012

Tab Control Change Tab Colors

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.

No comments:

Post a Comment