Hi all,
I have setup my project to use the Razor view engine for MVC as the following post details..
Using-MVC-Razor-With-Kentico-CMS-7I have setup 2 actions on my controller..
[HttpGet]
public ActionResult Create()
{
var example= new CustomClass();
return View(example);
}
[HttpPost]
public ActionResult CreatePost(CustomClass example)
{
if (!ModelState.IsValid)
return View(example);
return RedirectToAction("SomeView");
}
I have view for Create which has a basic form to post to the CreateProperty Action. If the model is invalid I want to return the invalid model to the view displaying the validation messages.
The problem I am having is that the DefaultModelBinder doesn't seem to be working at all. I cannot get into the CreatePost action. If I change the parameter type in CreatePost from CustomClass to FormCollection it works but I lose the benefits that the DefaultModelBinder brings.
Does anyone have any ideas?
cheers
Ian