I have a tab container with 5 tabs each having some charts inside them. I have set AutoPostBack = true and calling function to pouplate charts.
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" AutoPostBack="true" OnActiveTabChanged="Tab_changed"
CssClass="MyTabStyle">
<asp:TabPanel runat="server" HeaderText="Count" ID="TabPanel1" ><ContentTemplate>
<asp:UpdatePanel runat="server" ID="UpdatePanel1">
<ContentTemplate>
<asp:chart>
</asp:chart>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:TabPanel>
protected void Tab_changed(object sender, EventArgs e)
{
int index = TabContainer1.ActiveTabIndex;
if (index == 0)
{
count();
}
else if (index == 1)
{
created();
}
}
public void tt_count()
{
//code to populate charts
}
When I am in tab1 (count), charts for tab1 get populated, when I switch to tab2 (created), charts for tab 2 are getting populated. Its working fine. What I am trying to do is if I switch to tab1 again, a page should not refresh again as its taking a long for charts to get populated again.
I.e. if one tab has populated once and we return to that tab again, it should not again refresh or repopulate the data..