How to add a custom "Required" message? Is there an issue here?
Posted: Mon 30 Dec 2013 17:23
I am using v5.5.185 of ED.
I want to customise the "Required" validation message. The property is marked up as "Required". I went into "Attributes" for Diagram, Class and Property level and selected the "Required" data annotation, specified the "Error Text". Diagram and Class values caused a compile error in VS2012. Only specifying the error message at property level work.
However I also noted that this causes a "Duplicate" "required" annotation error in VS, until I specified that this property was not required by unchecking the required checkbox in the ED property editor. This worked, but it now looks as if this property is not required, unless one looks deeply into attributes for the custom "Required" attribute error message. Is this an issue with ED, or its design?
So what is the best method to implement custom "required" messages. It seems that you can only define the property has "Required" validation, but not what the message is.
Thanks,
I want to customise the "Required" validation message. The property is marked up as "Required". I went into "Attributes" for Diagram, Class and Property level and selected the "Required" data annotation, specified the "Error Text". Diagram and Class values caused a compile error in VS2012. Only specifying the error message at property level work.
However I also noted that this causes a "Duplicate" "required" annotation error in VS, until I specified that this property was not required by unchecking the required checkbox in the ED property editor. This worked, but it now looks as if this property is not required, unless one looks deeply into attributes for the custom "Required" attribute error message. Is this an issue with ED, or its design?
So what is the best method to implement custom "required" messages. It seems that you can only define the property has "Required" validation, but not what the message is.
Thanks,