Monday, March 26, 2012

With dynamic created Tabs extender any postback produce error, and temporary fix

I found another bug with Tabs extender:

On the page aspx

<ajaxToolkit:TabContainerID="Tab1"runat="server"Width="300px"ScrollBars="Auto"Enabled="true"ActiveTabIndex="0"></ajaxToolkit:TabContainer>

Then from server side, I add several tabs, but any button, click on that page would produce error:

Line 44: public new TabPanel this[int index]
Line 45: {
Line 46: get { return (TabPanel)base[index]; }
Line 47: }
Line 48: }
Source File:C:\Inetpub\wwwroot\AtlasControlToolkit-14384\Development\AjaxControlToolkit\Tabs\TabPanelCollection.cs Line:46

I fixed it temporarily with file TabContainer.cs, line 302 by using try and catch:

protected override void LoadClientState(object clientState)
{
Dictionary<string, object> state = (Dictionary<string, object>)clientState;
if (state != null)
{
ActiveTabIndex = (int)state["ActiveTabIndex"];
object[] tabState = (object[])state["TabState"];
for (int i = 0; i < tabState.Length; i++)
{
try
{
Tabs[i].Enabled = (bool)tabState[i];
}
catch
{
continue;
}
}
}
}

The error is still exist with the newest build# 14429. Can someone at least put the try and catch block into the new build?

No comments:

Post a Comment