I have create on module which is add in SitePages and add the webpart page and set that page as a home page of site on feature activation. and on feature deactivation I have wrote a code which will set the default.aspx as a home page of site. I have not wrote any code to remove my custom module then also it will remove custom module on feature deactivation the problem is that it will also remove the SitePages on feature deactivation.

Code of Elements.xml of CustomPages module

<Module Name="CustomPages" Url="SitePages"> <File Path="CustomPages\Sample.aspx" Url="CustomPages/Sample.aspx" Type="GhostableInLibrary" /> </Module>

How to stop removing the SitePages on feature deactivation?

1 Answer 1


I found solution. Instead of put my custom page into SitePages. I have put my module it into _catalogs/masterpage/ and remove module on feature deactivation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.