Wednesday, March 21, 2012

TabContainer Lag when loading controls by __doPostBack in OnClientActiveTabChanged

I am using a tabContainer on my web. My final product is a TabContainer nested inside of another TabContainer, but the latency is static between the two scenarios.
Here is a sample of my code:

 
 <script type="text/javascript"> function ActiveTabChanged2(sender, e) { __doPostBack(sender.get_id(), sender.get_activeTab().get_headerText()); } </script>

Container =new TabContainer(); Container.ID ="Container"; Container.OnClientActiveTabChanged ="ActiveTabChanged2"; Container.ActiveTabChanged +=new EventHandler(ActiveTabChangedServer); Container.CssClass ="ajax__tab_gray";public void ActiveTabChangedServer(object sender, EventArgs e) {string ID =""; TabContainer tab = (TabContainer)TabContainer1.ActiveTab.FindControl("Container"); TabContainer BottomTab = (TabContainer)tab.ActiveTab.FindControl("Container2"); ID = BottomTab.ActiveTab.ID.Substring(4); UpdatePanel Upd = (UpdatePanel)BottomTab.ActiveTab.FindControl("upTab_List"); Upd.ContentTemplateContainer.Controls.Add(new LiteralControl("test")); }

Now, everything functions properly with my scriptmanager catching the postback and rerouting it to an async, etc.

The problem is, there is 2 seconds where the server and client is doing absolutely nothing before it will write "test" in my updatepanel.

No matter what scenario I use, everything loads fine, the async postback is rerouted, but then after that there is 2 seconds of nothing before the text is written, as if I were to do a thread.sleep

any help would be much appreciated as this is a main part of my corporate intranet site and I would love to keep ajax as a part of that site, but 2 seconds on top of every loadtime is leading people to beleive the resource is broken as they click from tab to tab quickly with a blank page underneath each.

Thanks,

Brandon Schoen
Netlist
Sr. .Net Architect
www.netlistinc.com

0 replies... does this mean I am the only person to experience this issue?

No comments:

Post a Comment