httpModules 要素 (ASP.NET 設定スキーマ)

[このドキュメントはプレビューのみを目的としており、以降のリリースで変更される可能性があります。プレースホルダーとして空白のトピックが含まれています。]

アプリケーション内の HTTP モジュールを設定します。 この要素は構成階層の任意のレベルで宣言できます。

<httpModules> 
   <add... />
   <remove... />
   <clear/>
</httpModules>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

要素

Description

add

省略可能な要素です。

アプリケーションに httpModules 要素を追加します。

clear

省略可能な要素です。

アプリケーションからすべての httpModules 要素を削除します。

remove

省略可能な要素です。

httpModules 要素への参照を削除します。

値は、先行する add ディレクティブの値と正確に一致する必要があります。

親要素

要素

Description

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルで必要なルート要素を指定します。

system.web

ASP.NET 構成セクションのルート要素を指定します。

解説

既定の構成

次の既定の httpModules 要素は、.NET Framework Version 1.1 において Machine.config ファイルで構成されています。

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule"/>
     <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule"/>
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/>
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/>
     <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, 
          Version=1.0.5000.0, Culture=neutral, 
          PublicKeyToken=b03f5f7f11d50a3a"/>
</httpModules>

次の既定の httpModules 要素は、.NET Framework Version 1.0 において Machine.config ファイルで構成されています。

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
     <add name="Session" type="System.Web.SessionState.SessionStateModule" />
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
</httpModules>

次の既定の httpModules 要素は、.NET Framework Version 2.0 においてルートの Web.config ファイルで構成されています。

<httpModules>
     <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
     <add name="Session" type="System.Web.SessionState.SessionStateModule" />
     <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
     <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
     <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
     <add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
     <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
     <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
     <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />
     <add name="Profile" type="System.Web.Profile.ProfileModule" />
</httpModules>

使用例

3 つの HttpModule参照を ASP.NET アプリケーションに追加する方法を次のコード例に示します。

<configuration>
   <system.web>
      <httpModules>
         <add type="System.Web.Caching.OutputCacheModule" 
              name="OutputCache"/>
         <add type="System.Web.SessionState.SessionStateModule" 
              name="Session"/>
         <add type=Selector, selector.dll"
              name="Selector"/>
      </httpModules>
   </system.web>
</configuration>

要素情報

構成セクション ハンドラー

System.Web.Configuration.HttpModulesSection

構成メンバー

SystemWebSectionGroup.HttpModules

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

仮想ディレクトリ レベルまたは物理ディレクトリ レベルの Web.config

要件

Microsoft Internet Information Services (IIS) バージョン 5.0、5.1、または 6.0

.NET Framework Version 1.0、1.1、または 2.0

Microsoft Visual Studio 2003 または Visual Studio 2005

参照

処理手順

How to: Lock ASP.NET Configuration Settings

Reference

system.web 要素 (ASP.NET 設定スキーマ)

<configuration> 要素

httpModules の add 要素 (ASP.NET 設定スキーマ)

httpModules の clear 要素 (ASP.NET 設定スキーマ)

httpModules の remove 要素 (ASP.NET 設定スキーマ)

System.Configuration

System.Web.Configuration

概念

ASP.NET Configuration Overview

ASP.NET Server Controls and Browser Capabilities

Securing Configuration

Configuration Inheritance

その他の技術情報

ASP.NET Configuration Files

ASP.NET 構成設定

全般構成設定 (ASP.NET)

ASP.NET Configuration API