示例#1
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            MyEngineFactory myFactory = new MyEngineFactory();

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // This route accepts all
            routes.MapRoute(
                name: "WebDAV",
                url: "{*resource}",
                defaults: new {
                controller = "WebDAV",
                action     = "WebDAVMethod",
                resource   = UrlParameter.Optional,
                factory    = myFactory
            }
                , namespaces: new[] { "WebDAVdotNet.WebDAVController" }
                , constraints: null
                );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Default", action = "Index", id = UrlParameter.Optional }
                );
        }
示例#2
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            MyEngineFactory myFactory = new MyEngineFactory();

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // This route accepts all
            routes.MapRoute(
                name: "WebDAV",
                url: "{*resource}",
                defaults: new {
                    controller = "WebDAV",
                    action = "WebDAVMethod",
                    resource = UrlParameter.Optional,
                    factory = myFactory
                }
                ,namespaces: new[] { "WebDAVdotNet.WebDAVController" }
                ,constraints: null
            );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Default", action = "Index", id = UrlParameter.Optional }
            );
        }