Safe mode processing and Safe Controls

Friday, April 30, 2010

Any custom page is analyzed using the safe mode processing. This analysis puts security. processing in safe mode ensures that there is no script online personalized page. In other words insurance does not allow on-line processing mode script because a hacker attack can be mounted on the command line. If you try to run scripts online personalized page.

will get error ‘Code blocks are not allowed in this file’.

In case you still want to run in-line script in customized pages you need to specify ‘AllowServerSideScript=true’ in the ‘SafeMode’ tag section in web.config file.

<SharePoint>
<SafeMode ... >
<PageParserPaths>
<PageParserPath
VirtualPath="/sites/MySite/SitePages/*"
IncludeSubFolders="true"
CompilationMode="Always"
AllowServerSideScript="true" />
</PageParserPaths>
</SafeMode>
</SharePoint>


Insurance will help us determine the controls that will control customized pages. pages as controls can only be defined in the web.config file on the 'SafeControls. For example, in the following snippet of code that have defined custom pages can use the controls' Microsoft.SharePoint.WebControls.



<SafeControls>
<SafeControl
Assembly="Microsoft.SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
TypeName="*"
AllowRemoteDesigner="True" />
</SafeControls>

Posted by Rahul at 4:54 AM  

0 comments:

Post a Comment

Website Updates