Fix MVC 5 Dictionary Keys Disappearing During Form Binding
A settings form shows multiple choices but the controller receives an empty dictionary or duplicate keys. Applies to ASP.NET MVC 5 on .NET Framework. Use a staging or development copy to reproduce the behavior and inspect the actual response before changing production. Diagnostic flowchart Isolate the cause Are inputs named as indexed key and value pairs? Yes. Missing partners or duplicate keys can invalidate the shape the binder expects. No. Unrelated HTML input names do not become dictionary pairs simply because they are displayed together. Apply the fix Post a collection of typed input rows, then validate allowed keys and duplicates before building a dictionary. Keep the UI ordering separate from dictionary semantics. Copy code <input name="Entries[0].Key" value="Colour" /> <input name="Entries[0].Value" value="Blue" /> <input name="Entries[1].Key" value="Layout" /> <input name="Entries...