November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
Please write a bit more, are those properties part of block that is then used on a page? Or part of List<T> property?
Ideally please share the code for all models used.
Hi,
I have a specialized property in episerver named LocationInformation with a below given structure:
public virtual string Name{ get; set; }
public virtual string City { get; set; }
[RegularExpression("^(\\+\\s?)?((?<!\\+.*)\\(\\+?\\d+([\\s\\-\\.]?\\d+)?\\)|\\d+)([\\s\\-\\.]?(\\(\\d+([\\s\\-\\.]?\\d+)?\\)|\\d+))*(\\s?(x|ext\\.?)\\s?\\d+)?$", ErrorMessage = "Invalid Phone Number")]
public virtual string PhoneNumber { get; set; }
The phone property is not a required one & the given regex handles it fine. With the regex, validation kicks in the next instant.
Issue
Now when i create a custom attribute with the same regex in it ,the validation only kicks in when the page which includes this specialized location property is published.
Could some one shed some insights on why client validation kicks in with regex & not with custom attribute?
Additional details:
This specialized LocationInformation property is part of a block.Here is the code for the same:
This Contact block once configured is added on a standard page by the editor.
Note: [DistinctLocationInformation] is a custom attribute to check for any duplicate locations if any when you publish the contact block.
Regards.