ehaskins

I am trying to add some web parts that I built using the web part template for visual studio. I am using the batch file that is automatically generated by visual studio, and they get deployed with safe controls successfully. When I preview the web parts they appear fine, but I can't add them to my web page. When I try to add them I get the following error:

Unable to add selected web part(s).

Reset_Password Web Part: An error has occurred.

Change_Password Web Part: An error has occurrd.

and so on.

I tried some of the solutions that were added to a previous post, but none seem to apply. I also noticed that when I add other, standard web parts I get the same error. Here is a list when I try to add all of the available web parts:

Unable to add selected web part(s).

XML Web Part: An error has occurred.

User Tasks: An error has occurred.

Site Users: An error has occurred.

Reset_Password Web Part: An error has occurred.

Relevant Documents: An error has occurred.

Page Viewer Web Part: An error has occurred.

Image Web Part: An error has occurred.

Form Web Part: An error has occurred.

Content Editor Web Part: An error has occurred.

Change_Password Web Part: An error has occurred.

OK

So from what I can gather, 8 of the standard web parts are experiencing the same issues as my 2 custom web parts. This is compared to 6 of the standard web parts that are added properly. No errors are being logged so I can't seem to gather any additional information.

Please let me know if you have any suggestions as to why this may be happening. I have checked the safe controls, and I have tried adding these web parts individually, but neither helps.



Re: SharePoint - Development and Programming Unable to add selected web part(s). [Web Part Name]: An error has occurred. Please Help

DKeeling

I am not sure if you are using Render or adding child controls, either way you should wrap everything into a try-catch, and either add a control with the literal error, or writer.Write("Error: " + yourErrorVariable.Message);

That way you can handle the exception. I bet it is something easy to fix in the long run, if that does not help, then you can go into the web config and turn on debugging and the callstack. (CustomErrors = Off, and CallStack=True) to give more information.

-DK






Re: SharePoint - Development and Programming Unable to add selected web part(s). [Web Part Name]: An error has occurred. Please Help

ehaskins

Everything is in try catch blocks and inside the CreateChildControls method. If I go to site settings I can preview it fine, it just won't add it to the home page. It works fine on my development box, it is breaking on the test server. I'm not sure why, but quite a few of the standard web parts aren't working, so I was thinking it may be a configuration issue