Beispiel #1
0
        public override void RegisterRoutes(RouteCollection routes)
        {
            //routes.IgnoreRoute(@".*");  // Block all routes
            routes.IgnoreRoute(@"^.*css.*$");  // Block all routes to the css folder

            routes.MapRoute(
                name: "Default",
                regex: @"^[/]{1}$",
                defaults: new DefaultRoute { controller = "", action = "index.html", id = "" }
            );

            routes.MapRoute(
                name: "Json",
                regex: @"\json$",
                defaults: new DefaultRoute { controller = "Test", action = "GetJson", id = "" }
            );

            routes.MapRoute(
                name: "Allow All",
                regex: @".*",
                defaults: new DefaultRoute { controller = "", action = "", id = "" }
            );

            //routes.MapRoute(
            //    name: "Deny All",
            //    regex: @"$a",
            //    defaults: new DefaultRoute { controller = "", action = "", id = "" }
            //);
        }
Beispiel #2
0
        public override void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                name: "Default",
                regex: @"^[/]{1}$",
                defaults: new DefaultRoute { controller = "home", action = "gethello", id = "" }
            );

            routes.MapRoute(
                name: "Allow All",
                regex: @".*",
                defaults: new DefaultRoute { controller = "", action = "", id = "" }
            );
        }
 public virtual void RegisterRoutes(RouteCollection routes)
 {
     routes.MapRoute(
         name: "Allow All",
         regex: @".*",
         defaults: new DefaultRoute { controller = "", action = "", id = "" }
     );
 }
Beispiel #4
0
        public override void RegisterRoutes(RouteCollection routes)
        {
            // block access to the 'Deny' folder.
            routes.IgnoreRoute(@"^.*deny.*$");

            // maps the root folder specificly to 'index.html'.
            routes.MapRoute(
                name: "Default",
                regex: @"^[/]{1}$",
                defaults: new DefaultRoute { controller = "Home", action = "Index", id = "" }
            );

            // allows access to all other folders and files not explicitly ingored.
            routes.MapRoute(
                name: "Allow All",
                regex: @".*",
                defaults: new DefaultRoute { controller = "", action = "", id = "" }
            );
        }