Page.ContentType 屬性

定義

設定與頁面關聯之 HttpResponse 物件的 HTTP MIME 類型。Sets the HTTP MIME type for the HttpResponse object associated with the page.

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

屬性值

與目前頁面關聯的 HTTP MIME 類型。The HTTP MIME type associated with the current page.

屬性

備註

在大部分的情況下,請勿在程式碼中設定此屬性。In most circumstances, do not set this property in code. 使用 .aspx 檔案中的@ Page指示詞,設定 ContentType 屬性。Set the ContentType attribute using the @ Page directive in the .aspx file. 當要求頁面時,動態產生的類別會設定屬性。When the page is requested, the dynamically generated class sets the property.

適用於

另請參閱