System.Web Namespace HttpResponse Class
Sets or retrieves the HTTP MIME type of the output stream.
[ VB ]
Public Property ContentType As String
[ C# ]
public string ContentType {get; set;}
[ C++ ]
public: __property String* get_ContentType ( );
public: __property void set_ContentType ( String* );
[ JScript ]
public function get ContentType ( ) : String;
public function set ContentType ( String );
The HTTP MIME type of the output stream. The default value is " text/html ".
Exception Type |
Condition |
HttpException |
Occurs when ContentType is set to a null reference ( in Visual Basic Nothing ). |
The following example takes action if the content type of the output is not "Text/HTML".
if ( Response.ContentType != "Text/HTML" ) {
// ...
}
If Response.ContentType <> "Text/HTML" Then
' ...
End If |
|
C# |
VB |
HttpResponse Members