Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have this simple contact form with 3-4 fields and some error messages driven by data annotations (like required and data format). I would like those values to be pulled from Umbraco, ideally from dictionary items. This is also mainly because these error messages need to be localized in different languages.
My alternative will possibly be .resx files. But I was wondering if there is a fun / smart way to do this with Umbraco's data / cms driven functionnalities so that my content users can edit these.
Did you in the meantime found a way to get the errormessages from the umbraco dictionary? Hope you can help me.
Well, now I know what I'll be doing during the weekend, whether you've found a solution or not. This sounds cool
Unfortunately, this was 6 years ago haha :D I really don't remember how I handled the case :)
This was before Umbraco 7 if my memory serves well.
If you guys find a fun way to do this, do share !
Thanks for your reply. I found a way with custom atributes so i'm implementing it on this way now.
public class UmbracoRequired : RequiredAttribute, IClientValidatable
public UmbracoRequired(string umbracoDictionaryKey)
this.ErrorMessage = Helpers.Dictionary.TranslatedLabel(null, umbracoDictionaryKey);
this.ErrorMessageResourceName = null;
public IEnumerable<ModelClientValidationRule> GetClientValidationRules(ModelMetadata metadata, ControllerContext context)
yield return new ModelClientValidationRule()
ErrorMessage = this.ErrorMessage,
ValidationType = "required"
Helpers.Dictionary.TranslatedLabel(null, umbracoDictionaryKey); is a function that gets the text from my umbraco dictionary.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted