|
-
Jun 12th, 2012, 03:16 AM
#2
Re: MVC Create Error:EntityValidationErrors
You have validation attributes on the properties of your entity but your code is assuming that those attributes will never be violated. You need to check ModelState.IsValid to see whether the data entered by the user passes validation and only save it if it does. If it doesn't you need to redisplay the Create view with the validation errors so that the user can correct them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|