One more thing I need to add here before I share my code and solution, I had a break point on controller method but it was not breaking there, just throwing exception 500 internal server error. I have had the same error but b/c of diff reason. Then, I got the exact error posted by OP when I tried to save because currentModel now has ems AND currentModel.ItemsĪ simple change from "items" to "Items" fixed the problem. I didn't catch it, but in Visual Studio, it will auto lower case the first letter for Javascript properties (it could be a ReSharper thing too). In my Javascript, however, I did this, instead: ems = getData() ![]() ![]() Part of the process is to grab an array from some side process and set it to my currentModel.Items property and send currentModel to the server. So, some time later, I do some things and want to save, via Ajax. When I had first initialized the page I set my original model to a variable: var currentModel = result.Data I was doing some Ajax save where I was rebuilding the model to send back to the server. It is very related to the accepted answer, however, I did not have duplicated properties on my model, it was an issue with my Javascript. ![]() I would like to add an answer that I do not see here. ![]() +141 .AsyncResultWrapper.End(IAsyncResult BindComple圎lementalModel(ControllerContext I get this error whenever I submit the form also the action method is not being called because of this:Īn item with the same key has already been added.
0 Comments
Leave a Reply. |