Export (0) Print
Expand All

HttpRequest.AcceptTypes Property

Gets a string array of client-supported MIME accept types.

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

public string[] AcceptTypes { get; }
/** @property */
public String[] get_AcceptTypes ()

public function get AcceptTypes () : String[]

Property Value

A string array of client-supported MIME accept types.

The following code example captures the multiple values returned by the AcceptTypes property into an object variable and writes the number and name of each valueto a separate line of HTTP output.

int indx;
 
 String[] arr = Request.AcceptTypes;    
 for (indx = 0; indx < arr.Length; indx++) {
    Response.Write("Accept Type " + indx +": " + arr[indx] + "<br>");
 }
   

int indx;
String arr[] = get_Request().get_AcceptTypes();

for (indx = 0; indx < arr.length; indx++) {
    get_Response().Write(("Accept Type " + indx + ": "
        + arr.get_Item(indx) + "<br>"));
}

var arr : String[] = Request.AcceptTypes
for(var i=0; i < arr.Length; i++){
  Response.Write("Accept Type " + i + ": " + arr[i] + "<br>")
}
  

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

Community Additions

ADD
Show:
© 2014 Microsoft