Share via


Xml.DocumentContent 屬性

定義

設定字串,包含顯示於 Xml 控制項中的 XML 文件。

public:
 property System::String ^ DocumentContent { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(false)]
public string DocumentContent { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.DocumentContent : string with get, set
Public Property DocumentContent As String

屬性值

字串,包含顯示於 Xml 控制項中的 XML 文件。

屬性

備註

控制項中顯示的 Xml XML 檔是以三種方式之一指定。 您可以藉由設定適當的屬性來指定 System.Xml.XmlDocument 物件、XML 字串或 XML 檔案。 屬性 DocumentContent 用來指定 XML 字串, (表示要顯示在 控制項中的 XML 檔) 。 屬性 DocumentContent 通常不是以程式設計方式設定,或設定為 控制項的屬性。 相反地,XML 字串通常會以宣告方式設定,方法是在控制項的開頭和結尾 <asp:Xml> 標記之間放置文字。

注意

DocumentContent雖然 屬性同時 get 包含 和 set 存取子,但只有 set 存取子很有用。 如果您使用 存取 get 子, String.Empty 則會傳回 。

適用於

另請參閱