2012-06-27 6 views
0

ASP.NET MVC3 응용 프로그램에서 작업하고 있습니다.홈 인덱스가 응용 프로그램이 시작될 때로드되지 않습니다.

보기에서 나는 Home이라는 폴더와 Index라는 이름의 뷰를 만들었습니다.

그런 다음 Controller HomeController를 만들었습니다.

내가 주소 표시 줄에 추가하는 경우
The resource cannot be found. 
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. 

Requested URL:/

:/홈/색인보기로드 내가 응용 프로그램을 실행할 때

public ActionResult Index() 
    { 
     return View(); 
    } 

는하지만이 오류가 발생합니다 : 내가 추가 한 컨트롤러에서

정상적으로.

로드 할 때 응용 프로그램을 자동으로 홈/색인으로 만들 수 있습니까? 어떤 도움

+0

Global.asax 파일에 경로를 등록해야하는 것처럼 들립니다. –

+0

@PatrickPitre 그게 다야 !! 나는 내가 그것을 놓쳤다 고 생각할 수 없다! 고마워. 답변으로 작성하면 받아 들일 것입니다. – Youssef

+0

http://stackoverflow.com/questions/6554561/troubleshooting-the-resource-cannot-be-found-error의 복제본처럼 보이는 – HatSoft

답변

1

에 대한

덕분에 당신은 당신의 경로를 가리키는 Global.asax 파일에 경로를 추가해야합니다.

routes.MapRoute("Default", "{controller}/{action}/{id}", 
      new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
); 
관련 문제