I want to develop a feature(-event receiver) to override default.aspx. I want to use a webpart-page instead and add some webparts. I don't know how to override it. I know how to build a new webpart-page, but I don't know how to find default.aspx and replace it.Could you please provide me the information I'm missing?

1 Answer 1


Have a look at these article, it also summarizes some of the most common approaches to have web part deployed on existing page or with a new page http://blogs.msdn.com/b/uksharepoint/archive/2011/04/04/provisioning-web-parts-to-a-page.aspx

Also using the AllUsersWebPart is the prefered approach for Page Layouts in Publishing site, also known as declarative (versus writing code in a feature receiver to inject it into a page) - see here for more http://dotnetmafia.sys-con.com/node/1046923/mobile

Waldek goes into more details if you prefer still the programatic approach http://blog.mastykarz.nl/provisioning-web-part-instances-in-a-structured-and-repeatable-way/ or to insert it direclty in a an existing RTE zone http://blog.mastykarz.nl/programmatically-adding-web-parts-rich-content-sharepoint-2010/

  • Thank you, but none of these articles shows how to override default.aspx. They tell me how to build pages and add webparts. I'm using SP-Foundation, so I don't have publishing sites. Feb 20, 2013 at 14:54
  • 1
    Default.aspx is a web-part page by default in Team Sites, you could the exact same technique to 1. deploy your own Home.aspx - which would contain all web parts or add them programatically (by example), 2. Delete Default.aspx 3. set your page as the new Welcome (default) page for the site. Code routines to add Web parts to page are almost the same in Publishing/Web-Part pages. Feb 20, 2013 at 15:20
  • That sounds pretty similar to my expectations. But is it possible to delete default.aspx and save a new webpartpage as default.aspx? I don't want to save it in a doclib to avoid long urls and I don't want to use the standard default.aspx, because I customized the webpart-page-template and need the customizations in my landing-page. Of course I could set any page as the site's default-page but that changes the url. I want my landing-page similarto "hxxp://myspsite/subsite/default.aspx". I want to avoid something like "hxxp://myspsite/subsite/doclib/default.aspx". How do I achieve this? Feb 21, 2013 at 9:06
  • 1
    yes, that too! the major issue is that you cannot delete THE page that is set as Welcome page. That is why you have to go through creating a new one prior to deleting the Default Feb 21, 2013 at 16:42
  • Did I get you right? There is no way to create a new page called "default.aspx" and located in the website-root? Or is it possible to do something like this? 1. create new webpart-page somewhere. 2.set it as the landingpage 3. delete default.aspx 4 create new default.aspx 5 set it as the landing page? Thanks a lot for your help in advance! Feb 22, 2013 at 8:20

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.