Friday, December 03, 2010

ASP.NET MVC: The model of type ‘xxx’ could not be updated

The actual exception thrown is System.InvalidOperationException.

Set a breakpoint where the exception occurs. If you are calling UpdateModel, chances are you will find one or more validation exceptions in the ModelState.

Wouldn’t it be nice if the error message just said so?

No comments: