A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe

Hi Folks,

Today, I will discuss about the common issue occurred during web part development in SharePoint 2010 or 2013 or 2007. When we go for customization in SharePoint, first thing that comes to our mind is SharePoint Web Parts.  According to MSDN  “Web parts are server-side controls that run inside a web part page: they’re the building blocks of pages that appear on a SharePoint site.”

There are lot  of OOTB Web parts available and in addition to that, we can create our own web parts using Visual Studio 2010 or 2012. When we develop our own web parts and deploy it it SharePoint Pages, the following issue can occur.

A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe

Resolution :

As the error message clearly states that, the error message is due to

1. Missing Safe Control entries in Web.config.

2. Web Part dll is not deployed to GAC.

a.Either you change the Namespace of the web part assembly.

b. Webpart dll is missing in your SharePoint Farms.

In order to resolve this error, Please add the Safe Control entries of the newly created web parts.   The procedure is given below.

1. Open the DWP of your web part  in notepad and in  between . Add the SafeControl entry is as follows

<SafeControls>

<SafeControl Assembly=”Your Assembly Name” Namespace=”Your NameSpace” TypeName=”*” Safe=”True” AllowRemoteDesigner=”True”/>

</SafeControls>

 In my Another blog , you can check the common error that you face during development and the resolution as well.

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *