0
routes.MapRoute(
            name: "GetAdressen",
            url: "{controller}",
            defaults: new { controller = "AdressenController", action = "GetAdressen"}
        );
        routes.MapRoute(
            name: "GetEinsaetze",
            url: "{controller}",
            defaults: new { controller = "EinsaetzeController", action = "GetEinsaetze"}
        );

この場合、/Adressen のみが機能し、/Einsaetze は機能しません

        routes.MapRoute(
            name: "GetEinsaetze",
            url: "{controller}",
            defaults: new { controller = "EinsaetzeController", action = "GetEinsaetze"}
        );
routes.MapRoute(
            name: "GetAdressen",
            url: "{controller}",
            defaults: new { controller = "AdressenController", action = "GetAdressen"}
        );

この場合、/Einsaetze のみが機能し、/Adressen は機能しません

なんで?

4

1 に答える 1

0

このように使用

   routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "projectName.Controllers" });
于 2012-12-06T11:04:37.537 に答える