Partager via


add Element for handlers [IIS Settings Schema]

Note

For more information about the add element, see the following topic on the Microsoft IIS.net Web site: Adding Handlers <add>.

Specifies a handler to be added to the handlers collection.

Syntax

Attributes and Elements

The following sections describe attributes, child elements, and parent elements for this section.

Attributes

Attribute

Description

allowPathInfo

Optional Boolean attribute.

Specifies whether the handler processes full path information in a URI, such as contoso/marketing/imageGallery.aspx. If the value is true, the handler processes the full path, contoso/marketing/imageGallery. If the value is false, the handler processes only the last section of the path, /imageGallery.

The default value is false.

modules

Optional string attribute.

Specifies the name of the module or modules to which you want to map the file name or file name with extension. If you specify more than one value, separate the values with a comma (,).

The default value is ManagedPipelineHandler.

name

Required string attribute.

Specifies the unique name of the handler mapping.

path

Required string attribute.

Specifies the file name extension or the file name with extension for which the handler mapping applies.

preCondition

Optional string attribute.

Specifies conditions under which the handler will run.

The preCondition attribute can be one or more of the following possible values. If you specify more than one value, separate the values with a comma (,).

ValueDescription
bitness32 Specify the bitness32 value when the handler is a 32-bit .dll file, and IIS should load the handler only for worker processes that run in WOW64 mode (32-bit simulation) on a 64-bit operating system.
bitness64 Specify the bitness64 value when the handler is a 64-bit .dll file, and IIS should load the handler only for worker processes that run in 64-bit mode.
integratedMode Specify the integratedMode value when the handler should respond only to requests in application pools that are configured to use the integrated request-processing pipeline.
ISAPIMode Specify the ISAPIMode value when the handler should respond only to requests in application pools that are configured to use Classic mode.
runtimeVersionv1.1 Specify the runtimeVersionv1.1 value when the handler should respond only to requests in application pools that are configured to use .NET Framework version 1.1.
runtimeVersionv2.0 Specify the runtimeVersionv2.0 value when the handler should respond only to requests in application pools that are configured to use .NET Framework version 2.0.

requireAccess

Optional enum attribute.

Specifies the type of access that a handler requires to the resource.

The requireAccess attribute can be one or more of the following possible values. If you specify more than one value, separate the values with a comma (,). The default value is Script.

ValueDescription
Execute Specifies that the handler requires rights to run executables. The numeric value is 4.
None Specifies that the handler does not have access requirements. The numeric value is 0.
Read Specifies that the handler requires read permissions. The numeric value is 1.
Script Specifies that the handler requires rights to run scripts. The numeric value is 3.
Write Specifies that the handler requires write permissions. The numeric value is 2.

resourceType

Optional string attribute.

Specifies the type of resource to which the handler mapping applies.

The resourceType attribute can be one of the following possible values. The default value is Unspecified.

ValueDescription
Directory Specifies that the handler mapping applies to requests only for physical folders on disk. The numeric value is 1.
Either Specifies that the handler mapping applies to requests for physical files or folders on disk. The numeric value is 2.
File Specifies that the handler mapping applies to requests only for physical files on disk. The numeric value is 0.
Unspecified Specifies that the mapping type is not specified. The handler mapping applies to requests regardless of whether the request maps to a physical file or folder on disk. Use this setting when you map a handler to a file name or file name with extension that does not exist on disk, such as MyHandler.axd. The numeric value is 3.

responseBufferLimit

Optional integer attribute.

Specifies the maximum size, in bytes, of the response buffer for a request handler.

The default value is 4194304 bytes.

scriptProcessor

Optional string attribute.

Specifies the physical path of the ISAPI extension .dll file or Common Gateway Interface (CGI) .exe file that processes the request.

The scriptProcessor attribute is required only for script map handler mappings. When you map a handler to an ISAPI extension, you must specify ISAPIModule for the modules attribute. When you map a handler to a CGI file, you must specify CGIModule for the modules attribute.

type

Optional string attribute.

Specifies the namespace path of a managed handler. The type attribute is required only for managed handlers.

verb

Required string attribute.

Specifies the HTTP verbs for which the handler mapping applies.

Child Elements

None.

Parent Elements

Element

Description

configuration

Specifies the root element in every configuration file that is used by IIS 7.

system.webServer

Specifies the top-level section group (in ApplicationHost.config) in which this element is defined.

handlers

Specifies handlers to process requests made to sites and applications.

Remarks

For more information about the add element, see the following topic on the Microsoft IIS.net Web site: Adding Handlers <add>.

Element Information

Configuration locations

Machine.config

ApplicationHost.config

Root application Web.config

Application Web.config

Directory Web.config

Requirements

Microsoft Internet Information Services (IIS) version 7.0