System.Web.Configuration Namespace
.NET Framework version 2.0
Configures an HTTP handler for a Web application. This class cannot be inherited.
The HttpHandlersSection class provides a way to programmatically access and modify the httpHandlers section of a configuration file.
This type is part of a group that includes the HttpHandlerAction and HttpHandlerActionCollection types.
NOTE: The HttpHandlersSection can read and write information from and to the related section of the configuration file according to the AllowDefinition section property whose value is Everywhere.
The following code example shows how to use the HttpHandlersSection class to access the httpHandlers section of an existing Web application.
// Get the Web application configuration.
System.Configuration.Configuration configuration =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration ( "/aspnetTest" );
// Get the section.
System.Web.Configuration.HttpHandlersSection httpHandlersSection =
( System.Web.Configuration.HttpHandlersSection ) configuration.GetSection ( "system.web/httphandlers" );
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration ( "/aspnetTest" )
' Get the section.
Dim httpHandlersSection As System.Web.Configuration.HttpHandlersSection = _
CType ( configuration.GetSection ( "system.web/httphandlers" ), System.Web.Configuration.HttpHandlersSection ) |
|
C# |
VB |
The following configuration excerpt shows how to specify values declaratively for the httpHandlers section.
<httpHandlers>
<add path = "Calculator.custom"
type = "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler"
verb = "GET" validate = "false" />
</httpHandlers>
ASP.NET Configuration <httpHandlers> Section