I'm trying to customize the page that is used to show the content of folders in a certain (dynamically created) list. This page appeared to be AllItems.aspx. To customize the page I decided to replace the AllItems.aspx with a custom one. I can't use SharePoint-Designer, only Visual Studio.
Whenever a list of this type is created I delete the AllItems.aspx from "ListName/Forms/AllItems.aspx" and use a feature with module to insert the custom page into that folder. Like that:
file = currentWeb.GetFile("OffeneVorgaenge/Forms/AllItems.aspx");
file.Delete();
currentWeb.Features.Add(new Guid(Constants.FeatureIdVorgaengeAllItemsPage));
ActivateFeature(Constants.FeatureIdVorgaengeAllItemsPage, currentWeb);
However, after replacing the AllItems.aspx the page is no longer used to display the folder content, even though the replacement seemed to work fine (I checked if the file in the Forms-Folder is actually my customized AllItems.aspx and it was).
How can I fix this? Is there any smarter way to customize this page?