In Controller ----- ModelState.IsValid=false

You can Get Validation Error Messages from ModelState with using this function

var query = from state in modelState.Values from error in state.Errors select error.ErrorMessage;
 var errorList = query.ToList();
 return errorList;


Comments