11

Closed

TabContainer: Specified argument was out of the range of values #2

description

I do not believe that http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=7194 was fixed properly as i still get the error.

Here is the details of the error:

Source error;
Line 122: if (value >= Tabs.Count)
Line 123: {
Line 124: throw new ArgumentOutOfRangeException("value");
Line 125: }
Line 126: if (ActiveTabIndex != value)

Traceback:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value]
AjaxControlToolkit.TabContainer.set_ActiveTabIndex(Int32 value) in C:\Users\genbox\Desktop\AjaxControlToolkit-Framework3.5\AjaxControlToolkit\Tabs\TabContainer.cs:124
AjaxControlToolkit.TabContainer.LoadControlState(Object savedState) in C:\Users\genbox\Desktop\AjaxControlToolkit-Framework3.5\AjaxControlToolkit\Tabs\TabContainer.cs:378
System.Web.UI.Control.LoadControlStateInternal(Object savedStateObj) +118
System.Web.UI.Page.LoadAllState() +212
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1092


As you can see in the traceback. I'm not the one causing the error. It's getting the exception when it's trying to load the saved state of the tabcontainer. I do not believe that the state of the tabcontainer is saved properly and therefore the tabs are not present when loading the tabcontainer and the ActiveTabIndex then falls out of scope.

I hope it get's fixed right this time.
Closed Jun 19, 2009 at 11:03 PM by
Issue is resolved with change set 54957.

comments

jtpatil wrote Aug 25, 2008 at 8:50 PM

I'm also getting the same error (not frequently) when trying to set ActiveTabIndex:
TabContainer1.ActiveTabIndex = someValidIndex;

jtpatil wrote Aug 25, 2008 at 9:07 PM

I'm getting the error only on production environment and it's not frequent....and not able to reproduce it in development machine. But it seems that the error is thrown when retriving value of ActiveTabIndex....(not while setting ActiveTabIndex as stated in previous comment).

bklooste wrote Nov 27, 2008 at 5:52 AM

Happens 100% of the time when you have an event within a usercontrol which fires a postback and you have dynamically created pages but not the container in the page.

chohner wrote Apr 3, 2009 at 3:39 PM

http://siderite.blogspot.com/2007/07/fixing-tabcontainer-to-work-with.html

This patch works for me, it corrects the ActiveTabIndex issue in cs code and js code.