Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵狀

當您安裝以下更新之一後,部分 SharePoint 頁面無法轉譯,並產生 如下 的錯誤訊息:

網頁組件錯誤: 此頁面的網頁組件或網頁表單控制項無法顯示或匯入。 該類型無法找到,或未註冊為安全項目。

原因

您安裝更新後,ASP.NET 控制項的允許清單在 SharePoint 2010 和 SharePoint 2013 中被強制執行。 如果 SharePoint 頁面中的網頁元件或控制項未新增至允許清單,則頁面不會轉譯。

解決方案

如果 因頁面未使用  SafeControls 清單中的控制項而導致頁面無法轉譯,請遵循以下步驟:

  1. 檢閱 SharePoint 統一登入服務 (ULS) 記錄檔以查找  9s9ay  標籤或包含  "Blocking control with property" (表示控制項被封鎖)的訊息。

  2. 從錯誤訊息中識別類型、命名空間和組件強式名稱。 

    • 範例 1

    如果您看到下列錯誤訊息: 

    "The type Contoso.Customizations.WebPartControl, Contoso.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f8f11d50a3a could not be found or it is not registered as safe.”

    Type = "WebPartControl"

    Namespace = "Contoso.Customizations"

    Assembly strong name = "Contoso.WebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f8f11d50a3a"

    • 範例 2

    如果您看到下列錯誤訊息:

    "Blocking control with property traversal markup. [tagName: SharePoint:WebPartControl][propName: propName1][type: typeName1]"

    Type = "WebPartControl" (not "typeName1")

    您可透過查詢類型名稱,在  Microsoft Docs  中查找命名空間和組件資料。

  3. 以給定類型、命名空間和組件強式名稱新增 SafeControls  元素至 configuration/SharePoint/SafeControls 元素下的 Web.config 檔案(按照  SafeControls 元素(解決方案)中所述),然後將安全屬性設定為

如需有關 SafeControls 元素中的屬性值格式的更多資訊,請參閱在封裝設計工具中標記安全控制項中第 12 步中的表格。

因應措施

如果您有許多不安全的控制項,您可透過以下步驟解決此問題:

  1. configuration/SharePoint 元素下的 Web.config 檔案中編輯  SafeMode  元素。

  2. 新增屬性值為ControlCompatMode 屬性。

警告

我們不推薦此應因措施,因為它允許不安全的 ASP.net  控制項執行。

Content Idea RequestCONTENT IDEA REQUEST 120896
Author: secure
Writer: v-weizhu
Tech Reviewer: qingliu; gli; mswann
Editor: v-jesits

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×