views:

137

answers:

4

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.

A: 

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.

Peace and Grace, Greg

Twitter: @gbworld

Blog: http://gregorybeamer.spaces.live.com

Gregory A Beamer
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
+1  A: 

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

Janis Veinbergs
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
StackTrace won't reveal it? Set debug and stacktrace to true in web.config.
Janis Veinbergs
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
A: 

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.

-Faiz

Faiz
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
how many webparts you have on that page?
Faiz
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 <name> 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
A: 

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

Regards,

Azher Iqbal

Azher Iqbal
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