code_junkie

Asp.Net MVC Beta: Previous RouteData overrides current RouteData?

Nov 11th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public ActionResult Details(int id)
  2. {
  3. var viewData = new DetailsViewData
  4. {
  5. Booth = BoothRepository.Find(id),
  6. Category = ItemType.HotBuy
  7. };
  8. return View(viewData);
  9. }
  10.  
  11. routes.MapRoute("shows","shows/{controller}/{action}/{id}", new {id = 0});
  12.  
  13. www.mysite.com/shows/Booth/Details/1 => Details(1)
  14. www.mysite.com/shows/Booth/Details/2 => Details(1) //from ModelState["id"]
Add Comment
Please, Sign In to add comment