中止路由并继续.NET中的原始请求

时间:2010-08-16 16:28:58

标签: c# routing

我想对我的服务器的所有调用调用使用路由,然后仅对其中一些使用路由(取决于我的数据库中的值)。

我知道如何完成路由,我不知道如何在IRouteHandler中中止路由。

if (routing) 
{
  // do routing 
    var page = BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(IHttpHandler)) as IHttpHandler;
    return page;
}
else 
{
  // proceed as if no routing has been made
}

2 个答案:

答案 0 :(得分:0)

Respone.Redirect()

然后将它们重定向到错误或默认页面。

答案 1 :(得分:0)