London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi
We have a class which inherits ValidationAttribute and functions as expected on save by validating the desired properties correctly and results either in ValidationResult.Success or a new error message.
protected override ValidationResult IsValid(object value, ValidationContext validationContext) { return ValidateBlock(value, validationContext) ? ValidationResult.Success : new ValidationResult(ErrorMessage); }
However when the user tries to publish the page with the error present, rather then seeing the custom error message again they receive "Key cannot be null. Parameter name: key".
We've stepped through our code and can see our custom error message being generated on publish. No errors are thrown so we're not sure where this other error message is coming from.
Has anyone else experienced this?
Cheers
Jonathan.