开发者

ASP.NET MVC model validation error with edit scenario

开发者 https://www.devze.com 2023-01-02 02:23 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消