Saturday, April 16, 2011

How to go to SharePoint Webpart Maintenance page for any page

This is one of the great tips we have in SharePoint. There are many scenarios why we need this. I had very tough time to migrate a SharePoint 2007 site to SharePoint 2010 site. What happened was,
  1. The other team deployed a custom web part 2 years ago.
  2. Used that web part on different pages in that site.
  3. They have taken the site template from the option "save site as template".
  4. After an year, they have removed  that web part from the site collection.
  5. But, with the same site template they have taken in the step #3, they created few sites in the same site collection after they removed the web part from environment.
  6. Remember, the site template still has the references to that custom web part. So, when I try to migrate it always fails..
Sometimes it is very difficult to find what is causing the problem. The sites created were not published sites. So, I cannot go to Edit Properties of the page and go to web part maintenance page from there. As the default.aspx page is directly in the root of the site/web I do not have any other choice to go to web part maintenance page. After a long research I found from Google that the querystring ?contents=1 will do job for me.

In SharePoint, for any web part ASPX page if you append the querystring ?contents=1 then it automatically redirects to the web part maintenance page.

For the SharePoint site page
http://mossurl/default.aspx the web part maintenance page url is