Exception de sécurité du contrôle utilisateur ASP.NET

Mise à jour : 2008-04-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>

Voir aussi

Autres ressources

User control security exception in Microsoft Office SharePoint Server 2007