Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have deployed a custom webpart to a TeamSite using Visual Studio. I get this error message when i try to insert it to the home page.

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

I have checked the web.config and the entry for this webpart is very much there!

Any help is much appreciated! Thanks!

share|improve this question
1  
Does the webpart type and assembly the .webpart or .dwp file in the web part gallery match the details in web.config? –  James Love Jun 2 '11 at 10:38

2 Answers 2

There are three places that need to be synchronized in order a SafeControls entry to work:

1) The class file's namespace + class name 2) The SafeControls entry 3) The .webpart file

Watch out with Visual Studio 2010's namespacing, as when you create a new web part it will add the webpart name to the end of the namespace. If you remove that, so that all the web parts in your project use the same namespace, you'll need to also update the SafeControls entry and .webpart file accordingly.

share|improve this answer

Please check this post. You might find some solution.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.