About Me

Having 12 years experience in Microsoft technologies.Since more than 7 years working in SharePoint technologies. Expert in providing consultation for SharePoint projects. Hands on with development and administration.

Thursday, 27 October 2011

Making a Web Part Safe by Default

If you have a Web Part and want to make it safe anyway, you can add this information to the solution package, as shown in the following code.
<Solution SolutionId="{2E9DDE85-8822–42EC-3a92–E85537810BAA}"
<FeatureManifests />
<ApplicationResourceFiles />
<CodeAccessSecurity />
<DwpFiles />
<Resources />
<RootFiles />
<SiteDefinitionManifests />
<TemplateFiles />
<Assembly DeploymentTarget="WebApplication" Location="Apress.WebParts.dll">
<SafeControl Assembly="Apress.WebPart, Version=, Culture=neutral,
Namespace="Apress" TypeName="*" Safe="True"/>
This technique is limited to your own Web Parts, where you have control over the packaging process. But it’s the safest way to add controls to web.config.

No comments:

Post a Comment