संपादित करें

इसके माध्यम से साझा किया गया


HttpModulesSection.Modules Property

Definition

Gets the HttpModuleActionCollection of HttpModuleAction modules contained by the HttpModulesSection.

public:
 property System::Web::Configuration::HttpModuleActionCollection ^ Modules { System::Web::Configuration::HttpModuleActionCollection ^ get(); };
[System.Configuration.ConfigurationProperty("", IsDefaultCollection=true)]
public System.Web.Configuration.HttpModuleActionCollection Modules { get; }
[<System.Configuration.ConfigurationProperty("", IsDefaultCollection=true)>]
member this.Modules : System.Web.Configuration.HttpModuleActionCollection
Public ReadOnly Property Modules As HttpModuleActionCollection

Property Value

A HttpModuleActionCollection that contains the HttpModuleAction objects, or modules, defined by the HttpModulesSection.

Attributes

Examples

The following code example shows how to access the HttpModuleAction modules.


// Get the modules collection.
HttpModuleActionCollection httpModules = httpModulesSection.Modules;

// Read the modules information.
StringBuilder modulesInfo = new StringBuilder();
for (int i = 0; i < httpModules.Count; i++)
{
  modulesInfo.Append(
   string.Format("Name: {0}\nType: {1}\n\n", httpModules[i].Name, 
   httpModules[i].Type));
}
' Get the modules collection.
Dim httpModules As HttpModuleActionCollection = httpModulesSection.Modules

' Read the modules information.
Dim modulesInfo As New StringBuilder()
For i As Integer = 0 To httpModules.Count - 1
  modulesInfo.Append(String.Format("Name: {0}" + vbLf + "Type: {1}" + vbLf + vbLf, httpModules(i).Name, httpModules(i).Type))
Next

Remarks

The collection returned by this method does not refer to any actual element in the underlying configuration file. It is an ASP.NET infrastructure construct that allows easy access to the modules it contains. This is a common pattern for handling the elements of a configuration file.

Applies to

See also