.NET Framework Class Library
UrlRoutingHandler Class

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.Routing (in System.Web.Routing.dll)
Syntax

Visual Basic (Declaration)
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public MustInherit Class UrlRoutingHandler _
    Implements IHttpHandler
Visual Basic (Usage)
Dim instance As UrlRoutingHandler
C#
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public abstract class UrlRoutingHandler : IHttpHandler
Visual C++
[AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class UrlRoutingHandler abstract : IHttpHandler
JScript
public abstract class UrlRoutingHandler implements IHttpHandler
Remarks

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 Security

Inheritance Hierarchy

System..::.Object
  System.Web.Routing..::.UrlRoutingHandler
Thread Safety

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5 SP1
See Also

Reference

Tags :


Page view tracker