0

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?

3
  • could you check if the assembly is registered as safe in <SafeControls>in web.config ? Oct 19, 2012 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, 2012 at 11:26
  • try again and at the same time check the log with ULSViewer, then paste the relevant errors in your question Oct 19, 2012 at 12:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.