Problem with Ajax Tabpanel selection

499 Views Asked by At

I have a 2 tabpanels in my tabcontainer and both the panel has their own header text. I have put the tabcontainer inside a table.

Above the table (OR tabcontainer) I have a label and what I am trying to do is ... changing the label text as per tab selection ... code below:

if(tabcontainer.activetabindex == 0)
{
 label1.text = tabpanel1.headertext;
}

 else {label1.text = tabpanel2.headertext;}

But this is not working ... even if I select the panel2 my label displays the same text as panel1 header text ... it's not changing as I want.

Am I doing anything wrong? Please help.

Thanks, Rahul

1

There are 1 best solutions below

1
On BEST ANSWER

TabContainer changes active panel without postback, so your code doesn't fire.
You have to create javascript code and call it on tabchange in browser.