Vulnerability in EPiServer.Forms
Because of the need of substituting some properties with new ones of different types in an production environment, I need to supress the old ones and hide them from the editor. This is pretty straight forward when loading existing pages by hooking up to the EPDataFactory.LoadedPage event in Global.asax.cs event and setting prop.OwnerTab = -1.
But to do this, the page object is required and this is not provided when a page is created. So when creating a new page, I'm not able to hide the old properties.
Any chance of using another technique to hide them?
What about the CreatedPage event?
I'm not sure what EPiServer Version you are using but what about the LoadedDefaultPageData event? This event is fired when creating new pages in EPiServer 4.
One thing I have done in the past is simply creating another tab that the editors don't have access to and move the properties there.
Simple but it does the trick.
The CreatedPage event is not fired when episerver shows up the new page in edit mode, that is, before any save is performed. The LoadedDefaultPageData however will cut it.