Wednesday, March 21, 2012

Ajax TabContainer event.

Hi,
I have a Ajax tabcontainer on my webpage. How can I handle the events when I changed the tabs. I have usedOnActiveTabChanged event in the tabcontainer but it is not working. Please can any one help me? I am providing my code here. Your response is highly appreciated.

<ajaxToolkit:TabContainerID="TabContainer1"runat="server"Width="100%"ActiveTabIndex="0"
ForeColor="green"OnActiveTabChanged="TabContainer1_ActiveTabChanged" >
<ajaxToolkit:TabPanelID="tabPanelSiteDetails"runat="server"HeaderText="Site Details"BorderStyle="Dotted">
<ContentTemplate>
<uc8:HeadingMessageID="HeadingMessage1"runat="server"/>
<uc1:Sites_SiteDetailsID="Sites_SiteDetails2"runat="server"/>
</ContentTemplate>
</ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanelID="tabPanelCOntacts"runat="server"HeaderText="Contacts"CssClass="AjaxTabItem_Site">
<ContentTemplate>
<ucall:Sites_ContactDetailsID="ContactsAll"runat="server"/>
<br/>
<uc2:ContactsID="Contacts"runat="server"/>
<br/>
<uc7:EditDelteCancelID="EditDelteCancel3"runat="server"/>
</ContentTemplate>
</ajaxToolkit:TabPanel>

</ajaxToolkit:TabContainer>

***********CODE BEHIND CODE**************

protectedvoid TabContainer1_ActiveTabChanged(object sender,EventArgs e)
{
FillData();
}

Thanks & Regards

Not sure it will help , but could you try to set AutoPostback = true for tab container?


I have the same problem.

Autopostback=> "is not a valid attribute" !

The callback arrives only after a request to the server.

A solution is perhaps to use theOnClientActiveTabChanged and then starting a request from Javascript.

Is there a better way?

Sincerely

Stephan Schipal


I used the same thing (OnClientActiveTabChanged event). It is working for me.

Is there any way to control the background color of the TabContainer???


Hi,

The name of this attribute is AutoPostBack. Please note the three capital letters in the word.

And as far as I know from my own eperience and from the experience of many other users, server-side eventing functions properly.

Kind regards,

sbogus.



Yes,

You can control the whole outlook of a tab panel (the tab container's entity). You can override the CssClass attribute of the TabContainer control. In your own CSS you can then define own style and themes for the container.

For example to control the body's outlook of a tab panel you should override the class

/* tab's body */
.ajax__tab_new .ajax__tab_body

If you need further assistance, just ask here again.

Kind regards,

sbogus.

No comments:

Post a Comment