Beispiel #1
0
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.Define(rd =>
                            {
                                rd.Connect("hello/{name}", opts => opts.Default("controller", "Home")
                                                                       .Default("action", "Hello"));
                                rd.Connect("{controller}/{action}/{id}");

                            });

            //routes.MapRoute(
            //  "Hello",
            //  "hello/{name}",
            //  new { controller = "Home", action = "Hello" }
            //  );

            //routes.MapRoute(
            //    "Default",                                              // Route name
            //    "{controller}/{action}/{id}",                           // URL with parameters
            //    new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            //);
        }