Udostępnij za pośrednictwem


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

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

Dodaje httpModules element do aplikacji.

<add name="ModuleName"
   type=".NET Class, Assembly [,Version=version number]
      [,Culture=culture] [,PublicKeyToken=token]"/>

Atrybuty i elementy

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

Atrybuty

Atrybut

Opis

name

Wymagany atrybut.

Zawiera przyjazną nazwę dla modułu, który umożliwia powiązanie programu obsługi zdarzeń dla zdarzeń modułów w pliku global.asax.

type

Wymagany atrybut.

Określa kombinację klasa/zestaw oddzielone przecinkami, składający się z wersji, kultury i tokeny klucza publicznego. ASP.NET przeszukuje zestaw biblioteki DLL, najpierw w prywatnym katalogu \bin na wnioski, a następnie w pamięci podręcznej zestawów systemowych.

Elementy podrzędne

Brak.

Elementy nadrzędne

Element

Opis

configuration

Określa element główny 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.

httpModules

Konfiguruje moduły HTTP, które są w obrębie aplikacji.

Uwagi

add Dyrektyw są przetwarzane w kolejności góra dół "," sekwencyjnych. Jeśli dwa lub więcej add tagi podrzędne określić tę samą kombinację zlecenie/ścieżka, ostatni add zastępuje wszystkie pozostałe.

Domyślna konfiguracja

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

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

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

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

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

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

Przykład

Poniższy przykład kodu demonstruje, jak dodać httpModules element do aplikacji.

<configuration>
   <system.web>
      <httpModules>
         <add name="OutputCache"
              type="System.Web.Caching.OutputCacheModule, System.Web,
                    Version=1.0.2800.0, Culture=neutral,
                    PublicKeyToken=b03f5f7f11d50a3a"/>
      </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

httpModules elementu (ASP.Schemat ustawień netto)

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

<configuration> Element

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