Hey folks, I know this has to be one we have all seen a time or two. I'm trying to get my gridviews to not flicker when there is a partial post back so I'm using AjaxUpdatepanel with a timer as the asynch control. What happens is the page no longer flickers. However, when the page does its asynch postback, if I have another tab selected, teh tab index gets reset to 0. Anyway, onto my code:
aspx:
<asp:UpdatePanel ID="updGlobal" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"><Triggers><asp:AsyncPostBackTrigger ControlID="Timer1" /></Triggers><ContentTemplate><cc1:TabContainer ID="TabContainer1" runat="server" OnActiveTabChanged="Tabs_ActiveTabChanged" Width="100%" ActiveTabIndex="0">
.cs
if (!IsPostBack)
{
try
{
TabContainer1.ActiveTabIndex = (int)ViewState["ActiveTab"];
}
catch
{
}
}
protected void Tabs_ActiveTabChanged(object sender, EventArgs e)
{
ViewState["ActiveTab"] = TabContainer1.ActiveTabIndex;
}