Avoid using FormsCollection methodology for boxing and unboxing for ViewModels, so I wanted to use my custom ViewModel I created. Initially, I was receiving this error and thought it was an issue with my controller, when in fact it was my viewmodel that had the problem:
Parameterless Constructor defined for this object
MVC uses reflection to bind models, so in your viewmodel, you need a parameterless constructor (even though you may not use that method). You can also get the error above by not creating your controller methods properly, but that is usually pretty easy to fix.
0 comments:
Post a Comment