Page.ContentType Page.ContentType Page.ContentType Page.ContentType Property

定義

設定與頁面關聯之 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. 設定ContentType屬性使用@ Page .aspx 檔案中的指示詞。Set the ContentType attribute using the @ Page directive in the .aspx file. 當要求網頁時,將屬性設定動態產生的類別。When the page is requested, the dynamically generated class sets the property.

適用於

另請參閱