ASP.Net MVC form post FormCollection contains no key or missing some keys
I recently ran into an issue where FormCollection didn’t have any key.
This happens when you are using
- html controls (not generated via mvc html helper) and
- you didn’t assign value to name attribute to one or more controls.
Add name attribute to the html control, as rule of thumb keep value of name attribute same as id attribute. This should solve the issue.
Advertisement
Thanks for that!