Share via


ASP.NET user control security exception

Applies To: Office SharePoint Server 2007

This Office product will reach end of support on October 10, 2017. To stay supported, you will need to upgrade. For more information, see , Resources to help you upgrade your Office 2007 servers and clients.

 

Topic Last Modified: 2016-11-14

An ASP.NET user control loaded in Microsoft Office SharePoint Server 2007 generates a security exception related to connection security, as in the following example:

This control does not allow connection strings with the following keywords: 'Integrated Security', 'Trusted_Connection'.

Symptom

When you load an ASP.NET user control in a SharePoint Web part or Web form, a security exception occurs if the code uses NTLM authentication in the connection string. The security exception does not occur if Integrated Windows authentication is not used.

Cause

Controls or assemblies loaded from outside the global assembly cache are not trusted by default.

Resolution

Clear the tagMapping properties of the control by inserting the following lines in the Web.config file:

<code>
<tagMapping>
   <clear/>
</tagMapping>
</code>

See Also

Other Resources

User control security exception in Microsoft Office SharePoint Server 2007