What is safe mode processing and Safe Controls?

 Posted by ArticlesMaint on 9/24/2009 | Category: SharePoint Interview questions | Views: 9793

Any customized page is parsed using safe mode processing. This parsing brings in security. Safe mode processing guarantees that there is no inline script in the customized page. In other words safe mode processing disallows in-line script because a hacker can mount attack using in-line script. If you try to run in-line script on customized page you
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.


<SafeMode ... >
AllowServerSideScript="true" />

Safe controls help us define which controls the customized pages will have. Customized pages can only have controls which are defined in the web.config file in the ‘SafeControls’ tag. For instance in the below code snippet we have defined that customized pages can use controls from ‘Microsoft.SharePoint.WebControls’.


AllowRemoteDesigner="True" />

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response