MVC-route mit Standard-Aktion und parameter, mehrere Aktionen durch controller

Ich m versuchen zu erreichen route so:

http://mysite.com/portfolio/landscape

http://mysite.com/portfolio/friends etc...

hab ich geschrieben:

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                "DefaultIndex", //Route name
                "{controller}/{id}", //URL with parameters
                new { action = "Index", id = UrlParameter.Optional } //Parameter defaults
            );
            routes.MapRoute(
                "Default", //Route name
                "{controller}/{action}/{id}", //URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } //Parameter defaults
            );

        }

Es gut funktioniert, kann ich meine route /portfolio/Landschaft, aber mein Account Comptroller, die SignIn, SignOut, Index-Aktionen nicht funktioniert, weil es wird weitergeleitet auf Index jedes mal.

ist es möglich, um beides zu bekommen?

Danke im Voraus

InformationsquelleAutor fred_ | 2012-02-29
Schreibe einen Kommentar