2010-05-10 61 views
0

我有以下操作。我可以打這個如何在asp.net中傳遞友好網址中的查詢字符串mvc

/籃/地址?addressId = 123

但是我不知道如何與

/籃/地址/ 123

public ActionResult Address(int addressId) 
    { 
     return RedirectToAction("Index"); 
    } 

我的路線

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

     ); 

回答

1

更改:

public ActionResult Address(int addressId) 

public ActionResult Address(int id) 
相關問題