errors.add(:customer, 'Invalid country.')
I learned from the book Programming Microsoft® ASP.NET MVC, Second Edition that we should add error information of model with ViewData.ModelState.AddModelError method from System.Web.Mvc.ModelStateDictionary class.
ViewData.ModelState.AddModelError("Customer", "Invalid country.");
No comments:
Post a Comment