I am following Scott Gu's tutorial on ASP.NET MVC 2 model validation: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx I am using Linq To SQL 开发者_JAVA百科so tried the buddy class technique. This works fine when using a Create scenerio as in Scott's tutorial. But when used with an edit scenerio I am getting an error InvalidOperationException, the model of type .. could not be updated.
The error was returned as I did not reset the ViewData when a validation error occurs.
精彩评论