locked
Web Part Error RRS feed

  • Question

  • Hi,

    I've been migrating sharepoint site using Backup\Restore of stsadm commands. All the users & groups have been imported after restoring and everything works fine except web part.

    When I click some of the web parts it's showing "500 Internal Server Error" and some of the web parts are loaded correctly. Not sure what could be the problem.

    FYI, I'm trying to open the web part from Web part gallery after entering into Site Settings.

    Please help me out of this problem!!!

    -Orion
    • Edited by orionkings Thursday, August 25, 2011 4:54 AM misspelled
    Thursday, August 25, 2011 4:54 AM

Answers

  • Hi Orion,

    Using Backup\Restore commonds to migrate the SharePoint site will not back up the web.config file of the site, please check the web.config file of the web, whether the safe controls of the web parts are added to the web.config file.

    Also, there is a similar issue with other possibility, you can refer to it for more information:
    http://sharepointsharpener.wordpress.com/category/trouble-shooting/

    Thanks,
    Qiao Wei

    • Marked as answer by Emir Liu Monday, September 5, 2011 3:31 AM
    Tuesday, August 30, 2011 12:54 PM
    Moderator

All replies

  • What web parts?  Are the Out of the Box (OOB) web parts, or third party / custom web parts that you've installed?
    Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
    Thursday, August 25, 2011 10:58 AM
    Answerer
  • All web parts are custom web parts and created by ourself.

     

    The web part which has the following code is loaded correctly.

        public class WelcomeControl : System.Web.UI.WebControls.WebParts.WebPart
        {
            public WelcomeControl()
            {
            }

            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                Controls.Add(Page.LoadControl(@"~\controls\WelcomeControl.ascx"));

            }
        }

     

    The web part which has the following code is throwing a "500 Internal Server Error"

        [Guid("375d21a0-2877-4942-a306-d54d6144d3e8")]
        public class TaskWebPart : System.Web.UI.WebControls.WebParts.WebPart
        {
            public TaskWebPart ()
            {
            }

            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                Controls.Add(Page.LoadControl(@"~\controls\TwebPart.ascx"));
            }
        }

    All the controls which is called inside the code available in the respective location. Not sure what could be the reason?

     

    -Orion

     

    Friday, August 26, 2011 12:32 PM
  • Hi Orion,

    Using Backup\Restore commonds to migrate the SharePoint site will not back up the web.config file of the site, please check the web.config file of the web, whether the safe controls of the web parts are added to the web.config file.

    Also, there is a similar issue with other possibility, you can refer to it for more information:
    http://sharepointsharpener.wordpress.com/category/trouble-shooting/

    Thanks,
    Qiao Wei

    • Marked as answer by Emir Liu Monday, September 5, 2011 3:31 AM
    Tuesday, August 30, 2011 12:54 PM
    Moderator