SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When creating a web in Visual Studio it generates a web part where the namespace and the class name is the same. I'm thinking that this is giving me a problem with the limitedWebManager.ImportWebPart call. I'm fetching the .webpage file from the web part library and then adding it using ImportWebPart. I get the "not registerd as save" error (they work when I add them to the page manually, and it is in the web.config file). It works fine with "out of the box" webparts. But not with custome webpart.

I'm though maybe it has something to do with the class name and the namespace are the same. I tried to make test web part, and it did not work first (same error), but then I renamed it to not have the same name as the namespace and it worked. But I'm still unsure if that is the problem or not. So if someone have the same experience and can confirm my theory or not?

share|improve this question
could you check if the assembly is registered as safe in <SafeControls>in web.config ? – Anders Rask Oct 19 '12 at 11:10
Yes it is,I check it there and I can see the webpart content when clicking it the webpart list. – gaotter Oct 19 '12 at 11:26
try again and at the same time check the log with ULSViewer, then paste the relevant errors in your question – Anders Rask Oct 19 '12 at 12:11

Your Answer


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

Browse other questions tagged or ask your own question.