On my local environment all WFFM forms are working ok, however on our test environment when any form is submitted we get the error:
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:
Line 24: if (!IsPost)
Line 25: {
Line 26: queryString.Add("wffm." + Constants.FormItemId, Model.Item.ID.ToGuid());
Line 27: queryString.Add("wffm." + Constants.Id, Model.UniqueId);
Line 28: }
Source File: D:\home\site\wwwroot\Views\Form\EditorTemplates\FormViewModel.cshtml Line: 26
Note: I have tried uncehcking the field on the form Is Ajax Mvc Form
and this seems to resolve the issue.
Is there some configuration setting which could be causing this, since there is no difference in the form content itself between the two environments.
"wffm." + Constants.FormItemId
- that is the line it is failing on. Also - what are the values ofConstants.FormItemId
andConstants.Id
- do they come from config or hard coded values?