Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.