ModelState.AddModelError – How can I add an error that isn’t for a property?

I am checking my database in Create(FooViewModel fvm){…} to see if the fvm.prop1 and fvm.prop2 already exist in that combination; if so, I want to add an error to the modelstate, then return the whole view. I tried: public ActionResult Create(FooViewModel fvm){ if (ThatComboAlreadyExists(fvm)) { ModelState.AddModelError(“Model”, “There is already one like that”); return View(fvm); } … Read more

jQuery Ajax calls and the Html.AntiForgeryToken()

I have implemented in my app the mitigation to CSRF attacks following the informations that I have read on some blog post around the internet. In particular these post have been the driver of my implementation Best Practices for ASP.NET MVC from the ASP.NET and Web Tools Developer Content Team Anatomy of a Cross-site Request … Read more