共用方式為


XhtmlConformanceSection 類別

指定 ASP.NET 應用程式的 XHTML 轉譯模式。

Syntax

class XhtmlConformanceSection : ConfigurationSection  

方法

下表列出 類別所 XhtmlConformanceSection 公開的方法。

名稱 描述
GetAllowDefinition (繼承自 ConfigurationSection.)
GetAllowLocation (繼承自 ConfigurationSection。)
RevertToParent (繼承自 ConfigurationSection。)
SetAllowDefinition (繼承自 ConfigurationSection。)
SetAllowLocation (繼承自 ConfigurationSection。)

屬性

下表列出 類別所 XhtmlConformanceSection 公開的屬性。

名稱 描述
Location (繼承自 ConfigurationSection .) 金鑰屬性。
Mode 讀取/寫入 sint32 值,指定 ASP.NET 應用程式的 XHTML 轉譯模式。 後續的一節會列出可能的值。
Path (繼承自 ConfigurationSection .) 金鑰屬性。
SectionInformation (繼承自 ConfigurationSection。)

子類別

這個類別不包含子類別。

備註

根據預設,當您使用支援 HTML 4.0 或更新版本的瀏覽器時,ASP.NET 網頁和控制項轉譯與 XHTML 1.0 轉換標準相容的標記。 不過,在某些情況下,您可能不想 ASP.NET 轉譯 XHTML 標籤。 當您現有的頁面依賴 XHTML 通常會禁止的標籤或屬性時,通常會如此。

下表列出 屬性的 Mode 可能值。 預設值為 0 (Transitional) 。

關鍵字 描述
0 Transitional XHTML 標籤會轉譯為符合 XHTML 1.0 轉換標準。
1 Legacy 還原成其舊行為,一些可能中斷現有應用程式的轉譯變更。 沒有任何機制可還原所有所做的變更,以符合 XHTML 規格。 注意: 使用此設定可維持 ASP.NET 1.1 轉譯的一致性。
2 Strict 指定與 XHTML 1.0 標準的嚴格一致性。 發生的索引鍵變更是名稱屬性不再呈現在表單標記上。

繼承階層架構

ConfigurationSection

XhtmlConformanceSection

規格需求

類型 Description
Client - Windows Vista 上的 IIS 7.0
- Windows 7 上的 IIS 7.5
- Windows 8 上的 IIS 8.0
- Windows 10上的 IIS 10.0
伺服器 - Windows Server 2008 上的 IIS 7.0
- Windows Server 2008 R2 上的 IIS 7.5
- Windows Server 2012上的 IIS 8.0
- Windows Server 2012 R2 上的 IIS 8.5
- Windows Server 2016上的 IIS 10.0
產品 - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0
MOF 檔案 WebAdministration.mof

另請參閱

ConfigurationSection 類別
xhtmlConformance 項目 (ASP.NET 設定結構描述)