asp.net.ph

Response.ContentType Property

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 );

Property Value

The HTTP MIME type of the output stream. The default value is " text/html ".

Exceptions


Exception Type Condition
HttpException Occurs when ContentType is set to a null reference ( in Visual Basic Nothing ).

Remarks

The following example takes action if the content type of the output is not "Text/HTML".

if ( Response.ContentType != "Text/HTML" ) {
   // ...
}
  C# VB

See Also

HttpResponse Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph