2014-09-03 51 views
0

我有以下條目:MVC3路由給出的Global.asax 404

 routes.MapRoute(
      "Email", 
      "Email/{emailId}", 
      new { controller = "Email", action = "Index", emailId = UrlParameter.Optional} 
     ); 
     routes.MapRoute(
      "Details", 
      "Details/{rmaid}/{orderid}", 
      new { controller = "Details", action = "Index", rmaid = UrlParameter.Optional, orderid = UrlParameter.Optional } 
     ); 

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

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

了最後的退出是給我404

我家的控制器具有以下條目:

public ActionResult Logout() 
     { 
      Session.Abandon(); 
      return Redirect("/"); 
     } 

回答

1

首先輸入您的註銷路線,然後輸入默認路線。 但是,如果您不使用該註銷路線,您也可以導航到主頁/註銷。