Click here to Skip to main content
15,922,407 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
An item with the same key has already been added.

Exception Details: System.ArgumentException: An item with the same key has already been added.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: An item with the same key has already been added.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +51
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +7460188
   System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +11
   Geekees.Common.Utilities.Json.JsonObject.Add(String key, String item) +119
   Geekees.Common.Controls.ASTreeViewHelper.GetNodeJson(ASTreeViewNode node) +1592
   Geekees.Common.Controls.ASTreeViewHelper.GetNodeJson(ASTreeViewNode node) +443
   Geekees.Common.Controls.ASTreeViewHelper.GetNodeJsonString(ASTreeViewNode node) +122
   Geekees.Common.Controls.ASTreeView.GenerateTree() +434
   Geekees.Common.Controls.ASTreeView.OnPreRender(EventArgs e) +163
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

how i can resolve this?
Posted
Updated 22-Mar-11 19:44pm
v2
Comments
Wendelius 23-Mar-11 1:44am    
Pre tags added

1 solution

You're trying to add an element to the dictionary twice. If I read the stack correctly there's no your code executing when you get the message so could it be that you have used the same name for two different controls in your page?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 23-Mar-11 1:58am    
Correct Answer. My 5.
--SA
Wendelius 23-Mar-11 3:49am    
Thanks :)
honey4bee 24-Mar-11 3:23am    
k accepted
Wendelius 24-Mar-11 12:06pm    
If you like you can mark your answer solved. Best regards, mika

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900