HttpRequest.ContentType Property

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

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

Public Property ContentType As String
Dim instance As HttpRequest
Dim value As String

value = instance.ContentType

instance.ContentType = value
/** @property */
public String get_ContentType ()

/** @property */
public void set_ContentType (String value)

public function get ContentType () : String

public function set ContentType (value : String)

Property Value

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

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

Dim str As String
 str = Request.ContentType

String str;
str = get_Request().get_ContentType();

var str : String = Request.ContentType

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0