I ran into a really bizarre error today. We've created a custom page layout which sub classes PublishingLayoutPage to provide a custom contact us form with some basic validation controls. Everything works fine until we add the RegularExpressionValidator control. Once we do, we get this error:
RegularExpressionValidator is not allowed on this page or could not be found or it is not registered as safe. The things that I have verified.
- RegularExpressionValidator is registered as safe in web.config
- Our custom page layout code behind class is registered as safe in web.config
- The form works fine in a stand alone asp.net application
- Other validator controls in the same MS namespace work fine e.g. requiredvalidatorcontrol
This issue seems to be unique to SP2013 because I've done this sort of thing before with no issues. I would like to know why this one control will not work in this scenario.