HttpModuleActionCollection.Add(HttpModuleAction) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Lägger till ett HttpModuleAction objekt i samlingen.
public:
void Add(System::Web::Configuration::HttpModuleAction ^ httpModule);
public void Add(System.Web.Configuration.HttpModuleAction httpModule);
member this.Add : System.Web.Configuration.HttpModuleAction -> unit
Public Sub Add (httpModule As HttpModuleAction)
Parametrar
- httpModule
- HttpModuleAction
Modulen HttpModuleAction som ska läggas till i samlingen.
Undantag
Ett försök gjordes att lägga till ett HttpModuleAction objekt som redan finns i samlingen.
Exempel
I följande exempel visas hur du skapar ett HttpModuleAction objekt och lägger till det i samlingen.
// Create a new module object.
HttpModuleAction ModuleAction =
new HttpModuleAction("MyModuleName",
"MyModuleType");
// Add the module to the collection.
if (!httpModulesSection.SectionInformation.IsLocked)
{
modulesCollection.Add(ModuleAction);
configuration.Save();
}
' Create a new module object.
Dim ModuleAction As New HttpModuleAction( _
"MyModuleName", "MyModuleType")
' Add the module to the collection.
If Not httpModulesSection.SectionInformation.IsLocked Then
modulesCollection.Add(ModuleAction)
configuration.Save()
End If
Kommentarer
Lägger till ett HttpModuleAction objekt i samlingen.