A Web Part or Web Form Control on this Page cannot be displayed or imported. The type is not registered as safe.

Nov 19, 2008 at 9:26 PM
Im new to sharepoint, I downloaded and installed the guidance and followed it until the Upgrading the Tranining Management Application section.  I have an issue with the Custom Web Parts that are shown in the Manager Dashboard, they show an error message that says 
"Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type is not registered as safe."

What might it be? Do I need to keep going with the guide to fix it? I don't know what to do, is it normal at this point of the guidance?

Any help is very much appreciated.  Thanx!
Coordinator
Nov 24, 2008 at 10:23 PM
Edited Nov 24, 2008 at 10:24 PM

Take a look at the <SafeControls> element in the web.config. There should be two <SafeControl> nodes for the Contoso.TrainingMangement assembly:

 <

 

SafeControl Assembly="Contoso.TrainingManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" Namespace="Contoso.TrainingManagement.WebParts" TypeName="*" Safe="True" />

 

 

 <

 

SafeControl Assembly="Contoso.TrainingManagement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" Namespace="Contoso.TrainingManagement.Forms" TypeName="*" Safe="True" />

These nodes are defined in the manifest.xml and should have been added as part of the deployment process, which worries me if they are not there.

 If these nodes are there, perhaps the assembly has been compiled with a different snk file which would give you a new PublicKeyToken value.

 

Nov 28, 2008 at 11:20 PM
Thank you fcheung,  I looked at what you told me, and actually, the two assemblies weren't there.  The thing was I made something really wrong when I first deployed the TrainingManagement application, that was deploying in the central administration site and not the sharepoint default site.  I'm very new to sharepoint, so it's been hard to understand it well, yet I just reinstall the whole thing again, this time creating a valid sharepoint site, and now deploying on that site, everything is working perfect.

Thanx!
Jun 16, 2009 at 5:33 PM

Strangely I've just had the same problem, the entries were not there, I added them and it now works.

My install all went fine so I'm confused why they might not be getting added?

All the best

Coordinator
Jun 16, 2009 at 10:30 PM

First, what version of VSeWSS are you using?

I assume you packaged and deployed the Contoso.TrainingManagement project via VSeWSS. If you did, check the manifest.xml. It should include the two additions to SafeControl. Once deployed, SharePoint will update web.config.

-Francis