on 07-18-2007 12:18 PM
Hi ,
I am using TabStrip control of PDK .NET. I want to add tab dynamically in tabstrip control.
But I am getting error for any postback when I switch in between tabs.
Error description is :
<b>"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"</b>
<b>Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +2382545
SAP.Web.UI.Controls.TabCollection.get_Item(Int32 index) +6
SAP.Web.UI.Controls.TabStrip.LoadPostData(String sPostData, NameValueCollection oPostCollection) +92
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +674
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2965</b>
Any help appreciated?
Regards,
Prashant
Has anyone got a solution for this? I am doing the exact same thing, and having the exact same error....how do we persist the viewstate of the dynamically created tabstrip? I have already set EnableViewState to true.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prashant,,
your index is less than zero, the postback will not store it unless you explicitly save it using 'enable view state' for the tree control, if it is already enabled and still not working: here is the work around :-
you can store it in a hidden input field, so that it can be retrived when you do a postback, and then reassign the current index
it should be a relatively simple fix
please let me know how you get along...
with respect,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.