Showing posts with label onactivetabchanged. Show all posts
Showing posts with label onactivetabchanged. Show all posts

Wednesday, March 21, 2012

TabContainer and OnActiveTabChanged

Hi,
I read a lot of posts about the OnActiveTabChanged event but I would like to know what would be the best way to load dynamically the content of the selected Tab.
Here's my needs.
I have a tabcontainer with 3 tabs and I want to load the content on fly when the user selects a tab (of course without reload the entire page).
If someone could post the right code, that will be great.

Thanks in advance.
Stan

I think the best way to do this is to:

1) Put an UpdatePanel around the TabContainer

2) Hook the ActiveTabChanged event

3) When it fires for a given tab, add the content in the postback

Note there is a known issue with the TabContainer in an update panel - it's a cosmetic issue where you can see it redraw on postback.


OK I sat down and did a sample of this that loads each panel when the user selects it.

http://blogs.msdn.com/sburke/archive/2007/06/13/how-to-make-tab-control-panels-load-on-demand.aspx

TabContainer server event

Hi

I try to use TabContainer control and his event OnActiveTabChanged.

I have a simple page such as

<

cc1:TabContainerID="TabContainer1"runat="server"OnActiveTabChanged="TabContainer1_ActiveTabChanged"><cc1:TabPanelID="Tab1"runat="server"><ContentTemplate>

...

</ContentTemplate></cc1:TabPanel>

</

cc1:TabContainer>

And function

protectedvoid TabContainer1_ActiveTabChanged(object sender,EventArgs e)

{

string test ="sdfds";

}

But when i click on Tab and change active tab server event not fired.

Where is a problem?

Thanks

According to the documentation, the event should fire during a postback to the server, not in response to the tab being clicked.