Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpRequest.ContentType Property

Gets or sets the MIME content type of the incoming request.

[Visual Basic]
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

A string representing the MIME content type of the incoming request. For example, "text/html".

Example

The following example assigns the value representing the content type of the incoming request to a string variable.

[Visual Basic] 
Dim str As String
 str = Request.ContentType
   

[C#] 
String str;
 str = Request.ContentType;
   

[C++] 
String* str;
 str = Request->ContentType;
   

[JScript] 
var str : String = Request.ContentType
   

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace

Show:
© 2015 Microsoft