Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

The control type xyz is not allowed on this page. The type is not registered as safe.

$
0
0

Hi all,

I have a solution, say My.Solution, I have a project My.Project in that.In that project I have a few features.I added a visual webpart.In the properties of that, I can see that it has a safe control entry for that.I did not rename any namespace or class name. I just added this webpart to a new feature(which has List Definition and instance) and deployed it.The class name of the visual webpart is Foo and this is in the namespace My.Solution.Foo.

I opened the sharepoint designer and edited the masterpage.I referenced this in masterpage as

<%@ Register TagPrefix="cus" Namespace="My.Solution.Foo" Assembly="My.Solution, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87a45275f2ea36e3" %>

and I added this to the masterpage as

<cus:Foo runat="server" id="customvisualwebpart"/>

After I save in the designer and refresh the browser, I get the error,

The control type 'My.Solution.Foo.Foo' is not allowed on this page. The type is not registered as safe.

I checked the .webpart file and it has the namespace, My.Solution.Foo.Foo. The .spdata has a safecontrol entry too as

<SafeControl Name="SafeControlEntry1" Assembly="$SharePoint.Project.AssemblyFullName$" Namespace="My.Solution.Foo" TypeName="*" IsSafe="true" IsSafeAgainstScript="false" />

The assembly that contains the webpart is alread deployed to the GAC there.

The web.config for that in C:\inetpub\wwwroot\wss\VirtualDirectories\12345 does not have a safe control entry. I don't want to add it there manualy as I don't have access to web.config in prod

Can somebody tell me what is wrong and what I need to do to fix it?



Viewing all articles
Browse latest Browse all 11508


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>