Share via


ASP.NET 使用者控制安全性例外狀況

在 Microsoft Office SharePoint Server 2007 中載入的 ASP.NET 使用者控制項會產生與連線安全性相關的安全性例外狀況,範例如下:

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

問題

當您在 SharePoint 網頁組件或網頁表單中載入 ASP.NET 使用者控制項時,如果程式碼在連線字串中使用 NTLM 驗證,即會發生安全性例外狀況。如果未使用整合式 Windows 驗證,則不會發生安全性例外狀況。

原因

預設不會信任從全域組件快取外部載入的控制項或組件。

解決方法

在 Web.config 檔案中插入下行,以清除控制項的 tagMapping 屬性:

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

另請參閱

其他資源

在 Microsoft Office SharePoint Server 2007 UserControl 安全性例外狀況