1

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.

Leonidius
  • 648
  • 1
  • 9
  • 10

6 Answers6

1

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

Janis Veinbergs
  • 6,907
  • 5
  • 48
  • 78
  • My problem is not to remove the web part, but find out which one is causing the trouble and then install it, register it etc. – Leonidius May 21 '10 at 13:50
  • StackTrace won't reveal it? Set debug and stacktrace to true in web.config. – Janis Veinbergs May 21 '10 at 14:40
  • This is what I'm getting now. Ideally I would like to see webpart name that was added to the page, but not installed on the server. Any other suggestions ? [b: 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.] at Microsoft.SharePoint.ApplicationRuntime.g.a(Guid A_0) at Microsoft.SharePoint.SPWebPartCollection.a(Boolean A_0, Boolean A_1) – Leonidius May 21 '10 at 16:06
1
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.

Jason
  • 11
  • 1
0

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.

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
Gregory A Beamer
  • 16,870
  • 3
  • 25
  • 32
  • In my scenario I'm not a developer of the web part which does not work (in that case I would know what to do). I'm a troubleshooter of a page that was created 5 years ago by somebody else on a site that was migrated on a different server last year and some of the custom web parts were lost or not installed properly. I'm trying to find what this web part is, so I can install it (if I find its installer). – Leonidius May 21 '10 at 16:22
0

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.

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
Faiz
  • 367
  • 5
  • 19
  • 1
    contents=1, not content=1, yes, I know about it. What I get on that page is line like this "Error ErrorWebPart". How can I get the actual name of the webpart which causes the error ? – Leonidius May 24 '10 at 15:13
  • Some pages have only 2 web parts, that is 1 (usually out-of-box one) is working and one custom web part is missing. I would expect to get information like 'File/Class/Assembly your web part is referencing is not found on this server', so I can figure out what to install, but it's not the case. Instead I see a generic message like this 'Error ErrorWebPart' which does not tell me what to look for. – Leonidius May 25 '10 at 17:02
0

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!!!

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
Azher Iqbal
  • 547
  • 2
  • 4
  • 13
  • Kind of worked for me. After I restarted IIS Sharepoint seemed to reload all webparts registered in web.config. Those that are not found are reported in the Event Log. Looks like I won't be able to see missing webparts per page, but this approach is good too. I checked Event Log before, but did not realize that restarting IIS will give me a fresh snapshot of the environment at startup. – Leonidius Jun 01 '10 at 14:42
0

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

superjos
  • 12,189
  • 6
  • 89
  • 134