UrlRoutingHandler Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Serves as base class for classes that enable you to customize how ASP.NET routing processes a request.

Namespace:   System.Web.Routing
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Web.Routing.UrlRoutingHandler

public abstract class UrlRoutingHandler : IHttpHandler

NameDescription
System_CAPS_protmethodUrlRoutingHandler()

Initializes a new instance of the UrlRoutingHandler class.

NameDescription
System_CAPS_protpropertyIsReusable

Gets a value that indicates whether another request can use the UrlRoutingHandler instance.

System_CAPS_pubpropertyRouteCollection

Gets or sets the collection of defined routes for the ASP.NET application.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodProcessRequest(HttpContext)

Processes an HTTP request that matches a route.

System_CAPS_protmethodProcessRequest(HttpContextBase)

Processes an HTTP request that matches a route.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_protmethodVerifyAndProcessRequest(IHttpHandler, HttpContextBase)

When overridden in a derived class, validates the HTTP handler and performs the steps that are required to process the request.

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIHttpHandler.ProcessRequest(HttpContext)

Processes an HTTP request that matches a route.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIHttpHandler.IsReusable

Gets a value that indicates whether another request can use the UrlRoutingHandler instance.

You can customize how ASP.NET routing handles requests by mapping a file name extension to a particular routing handler instead of by using the UrlRoutingModule class as the routing handler for every request.

To customize how ASP.NET routing handles a request for a URL with a specific file name extension, you create a class that derives from the UrlRoutingHandler class. For example, you can create a customized routing handler that processes requests for a file that has the extension .abc.

To register a customized handler for a particular file name extension, you must add that handler in the Web.config file. The following example shows how to register a customized handler for an ASP.NET Web site that is running in IIS 6.0 or IIS 7.0 in Classic mode.

<system.web>
  <httpHandlers>
    <add verb="*" path="*.abc" 
        type="Contoso.Routing.CustomRoutingHandler" />
  </httpHandlers>
</system.web>

The following example shows how to register the same handler for an ASP.NET Web site that is running in IIS 7.0.

<system.webServer>
  <handlers>
    <add verb="*" path="*.abc"
        type="Contoso.Routing.CustomRoutingHandler" 
        resourceType="Unspecified" />
  </handlers>
</system.webServer>

.NET Framework
Available since 3.5

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: