StopRoutingHandler 类

定义

提供一种方式,用于指定 ASP.NET 路由不应处理 URL 模式的请求。Provides a way to specify that ASP.NET routing should not handle requests for a URL pattern.

public ref class StopRoutingHandler : System::Web::Routing::IRouteHandler
public class StopRoutingHandler : System.Web.Routing.IRouteHandler
type StopRoutingHandler = class
    interface IRouteHandler
Public Class StopRoutingHandler
Implements IRouteHandler
继承
StopRoutingHandler
实现

示例

下面的示例演示如何防止路由处理 axd 请求的请求。The following example shows how to prevent routing from handling requests for .axd requests.

routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));
routes.Add(New Route("{resource}.axd/{*pathInfo}", New StopRoutingHandler()))

注解

StopRoutingHandler利用类,你可以指定 ASP.NET 路由不应处理某些 URL 请求。The StopRoutingHandler class enables you to specify that ASP.NET routing should not handle certain URL requests. 通过定义路由并指定 StopRoutingHandler 应使用类来处理该路由的模式,阻止路由处理某些请求。You prevent routing from handling certain requests by defining a route and specifying that the StopRoutingHandler class should be used to handle that route's pattern. 当对象处理请求时 StopRoutingHandler ,对象会将 StopRoutingHandler 请求的任何其他处理阻止为路由。When a request is handled by a StopRoutingHandler object, the StopRoutingHandler object blocks any additional processing of the request as a route. 相反,请求将作为 ASP.NET 页、Web 服务或其他 ASP.NET 终结点进行处理。Instead, the request is processed as an ASP.NET page, Web service, or other ASP.NET endpoint.

构造函数

StopRoutingHandler()

初始化 StopRoutingHandler 类的新实例。Initializes a new instance of the StopRoutingHandler class.

方法

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetHttpHandler(RequestContext)

返回用于处理请求的对象。Returns the object that processes the request.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

IRouteHandler.GetHttpHandler(RequestContext)

返回用于处理请求的对象。Returns the object that processes the request.

适用于