Udostępnij za pośrednictwem


httpModules elementu (ASP.Schemat ustawień netto)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Konfiguruje moduły HTTP w obrębie aplikacji. Ten element może być deklarowany na dowolnym poziomie w hierarchii konfiguracji.

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

Atrybuty i elementy

W poniższych sekcjach opisano atrybuty i elementy podrzędne elementy nadrzędne.

Atrybuty

Brak.

Elementy podrzędne

Element

Opis

add

Opcjonalnego elementu.

Dodaje httpModules element do aplikacji.

clear

Opcjonalnego elementu.

Usuwa wszystkie httpModules element z aplikacji.

remove

Opcjonalnego elementu.

Usuwa odwołanie do httpModules element.

Wartość musi dokładnie odpowiadać poprzedniej add dyrektywy.

Elementy nadrzędne

Element

Opis

configuration

Określa element główny wymagane w każdym pliku konfiguracyjnym, który jest używany przez aparatu plików wykonywalnych języka wspólnego oraz.NET Framework aplikacji.

system.web

Określa element główny dla aplikacji ASP.Sekcja konfiguracji netto.

Uwagi

Domyślna konfiguracja

Następujące domyślne httpModules element jest skonfigurowany w pliku Machine.config w.NET Framework w wersji 1.1.

<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>

Następujące domyślne httpModules element jest skonfigurowany w pliku Machine.config w.NET Framework w wersji 1.0.

<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>

Następujące domyślne httpModules element jest skonfigurowany w pliku Web.config katalogu głównego w.NET Framework w wersji 2.0.

<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>

Przykład

Poniższy przykład kodu demonstruje, jak dodać trzy HttpModuledo aplikacji ASP.NET aplikacji.

<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>

Informacje o elementach

Program obsługi sekcji konfiguracji

System.Web.Configuration.HttpModulesSection

Członkowskie konfiguracji

SystemWebSectionGroup.HttpModules

Lokalizacje konfigurowalne

Machine.config

Web.config na poziomie katalogu głównego

Poziom aplikacji Web.config

Directory–level wirtualnego lub fizycznego Web.config

Wymagania

Microsoft Internet Information Services (IIS) w wersji 5.0, 5.1 lub 6.0

.NET Framework w wersji 1.0, 1.1 lub 2.0

Microsoft Visual Studio 2003 lub Visual Studio 2005

Zobacz też

Zadania

How to: Lock ASP.NET Configuration Settings

Informacje

System.Web elementu (ASP.Schemat ustawień netto)

<configuration> Element

Dodawanie elementu do httpModules (ASP.Schemat ustawień netto)

Usuń zaznaczenie elementu dla httpModules (ASP.Schemat ustawień netto)

Usuń Element dla httpModules (ASP.Schemat ustawień netto)

System.Configuration

System.Web.Configuration

Koncepcje

ASP.NET Configuration Overview

ASP.NET Server Controls and Browser Capabilities

Securing Configuration

Configuration Inheritance

Inne zasoby

ASP.NET Configuration Files

ASP.NET ustawienia konfiguracji

Ogólne ustawienia konfiguracji (ASP.(NET)

ASP.NET Configuration API