Try our conversational search powered by Generative AI!

Possible to avoid 'Simple address for this page' validation?


I need to alter the value entered into the 'Simple address for this page' field before saving the page. Running multiple sites so I need to programatically add a prefix to the simple address entered by the editor to make the url unique per site.

I've tried attaching to all the datafactory and urlsegment events but none of these fires before the edit page validates the simple url.

Any suggestions on how to solve this?


Feb 26, 2014 11:21

You could call EPiServer.GlobalPageValidation.RemoveDefaultValidators to remove the validators. However that will remove all validators and not just the simple address vaildator. You could then add back the other validators by calling:

//GlobalPageValidation.Validators += ValidateExternalURLHandler; (this is now removed)
GlobalPageValidation.Validators += ValidatePublishDatesHandler;
GlobalPageValidation.Validators += ValidateLanguageBranchHandler;
GlobalPageValidation.Validators += UrlSegment.ValidateEventHandler;
GlobalPageValidation.Validators += ValidatePageLink;

Then it would be up to you to validate the simple address.

Feb 26, 2014 11:58
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.