views:

256

answers:

1

Hi there,

I have setup some routes and they work so if i put localhost/MyWebApp/Reservas ...... it works.

I have setup up a default route that if somebody enter localhost/MyWebApp it should go directly to the Reservas route ... but it doesn't..

I have installed a route debugger and it appears nothing matches the request.. am i doing something wrong?

Can you help? ... here is my routes .. notice the last route is the DEFAULT route that i preusume should kick in and send me via the Reservas route

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

        routes.MapRoute(
            "Reservas", // Route name
            "Reservas/{action}/{jsonData}", // URL with parameters
            new {controller = "Reservation", action = "Index", jsonData="" } // Parameter defaults
            );


            routes.MapRoute(
            "Default",                                              // Route name
            "Reservas/{action}/{jsonData}",                           // URL with parameters
            new { controller = "Reservation", action = "Index", jsonData = "" }  // Parameter defaults
            );
A: 

Your current default route will only match when the URL looks something like /MyWebApp/Reservas. You should change it to look something like this:

routes.MapRoute(
    "Default",
    "{controller}/{action}/{jsonData}",
    new { controller = "Reservation", action = "Index", jsonData = "" });
LukeH
Thank you Luke, yes i thought i tried that as well.. but i retried it and it works... THANK YOu
mark smith