I'm finally working on an Umbraco 7 project (hooray!) but just spend some time investigating a surface controller for which the model went missing after HTTP POST. In the controller action the view model returned would always be NULL:
[HttpPost]
public ActionResult HandleFormSubmit(PublicationFormViewModel model)
{
}
After tripple-checking my setup everything seemed to be in place so I started removing some fields from the form in the view, and it turns out a property named "Model" of type int is the culprit:
public class PublicationFormViewModel
{
public int Model { get; set; }
}
Once I renamed this property, the view model is passed to the controller correctly after post.
So I was wondering, is this some kind of built-in property used by ASP.NET MVC or Umbraco?
Cannot use property Model in view models
Hi guys,
I'm finally working on an Umbraco 7 project (hooray!) but just spend some time investigating a surface controller for which the model went missing after HTTP POST. In the controller action the view model returned would always be NULL:
After tripple-checking my setup everything seemed to be in place so I started removing some fields from the form in the view, and it turns out a property named "Model" of type int is the culprit:
Once I renamed this property, the view model is passed to the controller correctly after post.
So I was wondering, is this some kind of built-in property used by ASP.NET MVC or Umbraco?
Thanks Lennart
is working on a reply...