Showing posts with label Master Page. Show all posts
Showing posts with label Master Page. Show all posts

Tuesday, April 7, 2009

This item cannot be deleted because it is still referenced by other pages. (Page Layout or Master Page)

I have moved all references to a Page Layout to a different Page Layout. But when I try to delete the Page Layout, I get this error.

"This item cannot be deleted because it is still referenced by other pages”

After spending hours trying to modify my code, thinking I'm missing references somewhere, I finally searched around for this error. I found that it is a Microsoft known bug. Their workaround is to check the Hidden Page in the properties of the Page Layout or Master Page, and if it is currently a Master Page, change it to a Page Layout. That will keep it from being selectable when creating a page.

But, here is the real workaround that I found out there...

1. Create a folder inside the Master Page Gallery.
2. Move the Page Layout or Master Page you don't want and are not using anymore.
3. Delete the folder.

I can only guess at why it works, but it does, and I'm glad someone out there thought to try such a thing.