More in this section

Forums / General Discussions / "Item with the same key" when viewing one page

"Item with the same key" when viewing one page

9 posts, 0 answered
  1. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    09 Sep 2011
    Link to this post
    I recently upgraded to 4.2 and have been having a number of issues. One that I need some help with is occurring when I'm logged in and try to view our main home page. I'm getting the error pasted below.

    I have already inspected the database to ensure that there aren't duplicate versions of the news items.

    Any ideas?

    ------------------------------

    An item with the same key has already been added.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    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.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +12676752
       System.Collections.Generic.Dictionary`2.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(KeyValuePair`2 keyValuePair) +30
       Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit.ContentBrowseAndEditToolbar.ManageMode(BrowseAndEditToolbarMode mode, String controlID, String commandName, SecurityActionTypes securityType) +1114
       Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit.ContentBrowseAndEditToolbar.InitializeCommands() +119
       Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit.ContentBrowseAndEditToolbar.Configure(ContentView host, Content contentItem, Content parentItem) +1056
       Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit.BrowseAndEditManagerExtensions.AddConfiguredContentBrowseAndEditToolBar(BrowseAndEditManager manager, Content contentItem, ContentView host, ContentBrowseAndEditToolbar toolbar, Content parentItem) +45
       Telerik.Sitefinity.Modules.News.Web.UI.MasterListView.NewsList_DataBound(Object sender, EventArgs e) +379
       Telerik.Web.UI.RadListView.PerformSelect() +217
       System.Web.UI.Control.LoadRecursive() +95
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Control.LoadRecursive() +190
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2760
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225 

  2. Sonya
    Sonya avatar
    205 posts
    Registered:
    09 Dec 2016
    12 Sep 2011
    Link to this post
    Hi Josh Anderson,

    Please try to delete your cookies/temp files and check if the problem still exists.

    To to this:
    1.IE>Tools menu>Internet Options
    2. General Tab> Browsing History section > Click Delete button.
    3. Select Cookies(or all) and click Delete

    1. Firefox>Tools menu
    2. Click Clear Recent History - select  Cookies (or all)
    3. Click Clear Now or  use Ctrl+Shift+Delete

     

    All the best,
    Sonya
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    12 Sep 2011
    Link to this post
    That did not work. This issue occurs in every browser on every OS I've tried (Chrome, Firefox, Safari, IE on Mac OSX and Win7). It's likely not a client-side issue.

    To be more clear, this error does not occur when attempting to edit the page via the dashboard, only when viewing the page when you're logged in (which generates the edit-in-place controls).

    Incidentally, editing the page via the dashboard fails, too, but not with an error. It shows content blocks that don't exist in the actual page and no controls are clickable. I assumed it was some sort of javascript conflict, but perhaps it's all related.

    Josh
  4. Sonya
    Sonya avatar
    205 posts
    Registered:
    09 Dec 2016
    12 Sep 2011
    Link to this post
    Hi Josh Anderson,

    Usually controls are not editable when they are placed in Page Template. Could you please check if there are duplicated  IDs of the controls placed in the page? To check this:
    - select any control and click Edit>Advanced
    - go to 'ID' field and compare the IDs of all controls.
    Change the ID if already exists.

    Greetings,
    Sonya
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    12 Sep 2011
    Link to this post
    I'd love to be able to do that, but right now I can't edit the page at all, so unless there's a way I can find those IDs in the database I'm not going to be able to perform the requested task without some help fixing the other editing problem. In any case, I have my doubts that it's a control ID issue anyway. If you look at the stack trace it appears to be throwing an error when databinding the news items. The error that there's a duplicate item seems to suggest that it's an issue with a news item being added to the dictionary with a duplicate key.

    So, on to my problem editing...

    If I go to the Pages section of the dashboard and click to edit the home page, I get what you see in the attached file. The layout RadDock items are visible, with dummy content that doesn't actually appear in the real site (which you can view at http://www.telephonypartners.com). Nothing is clickable. When I click "Back to Pages" nothing happens. Nor does anything happen when you click the Layout button, or any of the widgets, or the edit icon on the content blocks. I have to use the browser back button, which results in the page remaining locked, so I then have to unlock the page.

    I have removed all javascript from the master page to ensure that it's not conflicting and have confirmed using Firebug that nothing has been added other than the Telerik scripts.

  6. Milena
    Milena avatar
    75 posts
    Registered:
    27 Sep 2017
    15 Sep 2011
    Link to this post
    Hello Josh Anderson,

    Could you please, send us the whole project (project files, database, backend credentials) to debug the issue locally ?

    Many thanks in advance!
    Greetings,

    Milena
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Hristo Borisov
    Hristo Borisov avatar
    190 posts
    Registered:
    19 Jun 2017
    15 Sep 2011
    Link to this post
    Hi Josh Anderson,

    Thank you for giving us this extra information, it was really helpful to identify the cause of your problems. We have manage to reproduce the problem, and it is logged for our next official release Sitefintiy 4.3 that is due October according to our public Sitefinity roadmap.

    Thank you for contacting us, and please excuse us for the inconvenience, we will do our best to resolve your issue as soon as possible.

    Best wishes,
    Hristo Borisov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Josh Anderson
    Josh Anderson avatar
    48 posts
    Registered:
    15 Dec 2005
    15 Sep 2011
    Link to this post
    Do you know of any workaround? Right now I have no way of editing that page since I get an error when doing edit-in-place and I get the broken interface when editing from the administrator dashboard.

    Do you still need me to send in the project and DB since you were able to reproduce the error?

    Josh
  9. Milena
    Milena avatar
    75 posts
    Registered:
    27 Sep 2017
    20 Sep 2011
    Link to this post
    Hi Josh Anderson,

    Yes, can you provide us with (project files, database, back-end credentials) to debug the issue locally and try to propose a fix of  the problem.

    Many thanks!

    Regards,
    Milena
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
9 posts, 0 answered