2
web.config 변경 및 필요한 어셈블리 추가와 같은 모든 단계를 수행했습니다.
ASP.Net and Webforms in Harmony MVC3을 webforms 프로젝트에 설치하고 컨트롤러를 구현하고 Global.asax의 Application_Start 메소드에 해당 경로를 등록했습니다.MVC3을 웹 폼에 통합 - MVC 라우팅이 작동하지 않음
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
여기에 나는 그것의 행동 (즉/홈/색인)하지만 404 찾을 수 없음 오류가 전화를하려고 컨트롤러
public class HomeController : Controller
{
//
// GET: /Default1/
public ActionResult Index(int? id)
{
ViewData["Message"] = "Hello from Home controller";
return View();
}
}
입니다.
다른 .aspx 양식에 대해 등록 된 경로가 정상적으로 작동합니다.
routes.Add("Home", new Route("Home", new RoutingHandler("/Default.aspx")));
모든 것이 잘 작동하지만 (집/색인)가 표시되지 않습니다.