示例#1
0
        public static Route MapGenericPathRoute(this RouteCollection routes, string name, string url, object defaults, object constraints, string[] namespaces)
        {
            if (routes == null)
            {
                throw new ArgumentNullException("routes");
            }
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            var route = new SeoRoutes(url, new MvcRouteHandler())
            {
                Defaults    = new RouteValueDictionary(defaults),
                Constraints = new RouteValueDictionary(constraints),
                DataTokens  = new RouteValueDictionary()
            };

            if ((namespaces != null) && (namespaces.Length > 0))
            {
                route.DataTokens["Namespaces"] = namespaces;
            }

            routes.Add(name, route);

            return(route);
        }
示例#2
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     LocationRoutes.RegisterRoutes(context);
     SearchRoutes.RegisterRoutes(context);
     CacheRoutes.RegisterRoutes(context);
     SeoRoutes.RegisterRoutes(context);
     DevRoutes.RegisterRoutes(context);
     ResumesRoutes.RegisterRoutes(context);
     CouponsRoutes.RegisterRoutes(context);
 }
        public static void RegisterRoutes(RouteCollection routes, bool databaseInstalled = true)
        {
            //routes.IgnoreRoute("favicon.ico");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");
            routes.IgnoreRoute(".db/{*virtualpath}");

            // register routes (core, admin, plugins, etc)
            GeneralRoutes routePublisher = new GeneralRoutes();

            routePublisher.RegisterRoutes(routes);

            SeoRoutes routePublisher3 = new SeoRoutes();

            routePublisher3.RegisterRoutes(routes);
        }