Validation Error on SaveChanges()

前端 未结 3 1296
时光说笑
时光说笑 2020-12-23 02:35

I have the following Action method inside my Asp.net mvc web application:-

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(SDJoin sdj, FormC         


        
3条回答
  •  温柔的废话
    2020-12-23 02:49

    I know the question is old now, but I hope someone finds this useful, too.

    1. Most likely (and indeed, judging by your comments) the error was that your variable doesn't pass Model validation.
    2. The other way to see the errors you couldn't see (without changing the code) is to look at the exception using the QuickWatch window. The problem is that 'View Details' window that you can open from exception tooltip doesn't show EntityValidationErrors. And without a catch block you don't have any exception variable you can look at in QuickWatch. Luckily, QuickWatch has PseudoVariables. So, using "$exception" pseudovariable you can easily take a look at the current unhandled exception in QuickWatch window. (Please, see screenshots below) Exception Details window and QuickWatch window with $exception pseudovariable

提交回复
热议问题