必须填写至少10个字的日志
nnhy 编写于 2012-07-27 18:48:21
X
using System;
using System.Collections.Generic;
using System.Web;
using NewLife.Mvc;

/// <summary>
///Urls 的摘要说明
/// </summary>
public class Urls : IRouteConfig
{

    public void Config(RouteConfigManager cfg)
    {
        cfg
            .Static("/static.bmp")
            .Static("", delegate(IRouteContext ctx)
            {
                return ctx.Path.EndsWith(".txt");
            })
            .Redirect("/rootredirect", "/Test")
            .RouteToFactory<RouteFactory>("/specFactory")
            .Route<TestController>("/Test")
            .Route(
            //"/foo.aspx$", typeof(GenericControllerFactory),
                "/Test1$", typeof(TestController1),
                "/Test2", typeof(TestController2),
                "/Factory1", typeof(TestFactory),
                "/Error", typeof(TestError),
                "/Module", typeof(TestModuleRoute),
                ""
            )
            ;
    }
}