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

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
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.