이것은 내 Global.asax입니다. 다른 URL 형식을 컨트롤러 및 작업에 매핑하고 싶습니다.MVC URL 라우팅이 작동하지 않습니다.
//Matching to auctions-index-Testing
//Why this one is not matching to auction-index
routes.MapRoute("TestUrl", "{controller}-{action}-{name}",
new { name = UrlParameter.Optional }
);
//Matching to Home/Index/1
//Matching to Home/Index
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
저는 왜 경매 색인에서 "자원을 찾을 수 없습니다"오류가 발생하는지 궁금합니다. 이름은 선택 사항이며 표의 첫 번째 항목입니다. 그래서이 URL
와 일치해야 도움과 제안
당신은 404를 얻고 있습니까? – Nikshep
http : // servername/auctions-index는 404 – paritosh