Question

Does anybody know how to find offending web part which causes this error ?

“A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.”

I have inherited an old SharePoint 2003 portal site which uses custom web parts.

I know what this error means. I also know that each web part must be installed and registred as safe in web.config. The problem is that I don't know which one is missing. I get same error when I'm trying to open the page in FrontPage as well.

Was it helpful?

Solution

Go to Event Viewer of the machine and you shall be able to see Error entries. Out of tons of entries you have to find out the entries related to you and you shall be able to see the names of the webparts that the sharepoint site is trying to load but fails. If you shall read the complete description of the error entry in the Event Viewer, it will give you version and even PublicKey Token of the webpart as well.

I hope this helps!!!

OTHER TIPS

Use contents=1 in QueryString to disable/remove WebParts from page that causes errors.

stsadm.exe -o enumallwebs -includewebparts

http://sharepointreporter.wordpress.com/

Requires updating to Sp2 I believe, for this command to be available. Problematic web parts will appear as 'Missing' in the resultant list.

Try reading this:

http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=189

It should give you some clues to solving the problem. Essentially you have a control that is not marked as safe and it is failing. You can most likely config it to work, but the link above has other possible solutions.

in your url just append content=1. This will give you the all the webparts that are deployed. Now, you can keep deleting each of the webpart to find which one is causing issue ( ensure that you know to add the web parts back).

For example: if Url is http://localhost:9000/default.aspx, try with http://localhost:9000?contents=1

Alternatively, try to create a new webpart page,add web parts that are there on your actual page and check which one is causing issue. This will avoid changes to the actual page.

Hope this helps.

I've just suggested this same answer on MSDN:

This stsadm helped me in finding where the webpart was referenced in any way:

stsadm -o enumallwebs -includewebparts > C:\temp\somelog.txt

Then you can see the web part is listed under some <Web Id=... Url=...> XML node, i.e. you know the "culprit" web site.

At that point, some reasons I've found for those forgotten references:

  • the webpart is used in some sub-site of the culprit website, and the sub site is hidden from the quick list or top bar

  • the webpart has been deleted from the culprit website, but it still is in the "site collection recycle bin". You can reach that by going to the normal website recycle bin, then look for its link on the top bar description ("Use this page to restore items that..."). By the way, this site collection recycle bin has two views itself: be sure to check them both.

In both cases, I got some help by browsing the culprit website with SharePoint Manager. With that I could easily spot the existence of a forgotten subsite, as well as the existence of this "second level recycle bin".

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top