2015-01-31 2 views
0

면도기에서 불꽃으로 변환하려고합니다. 여기 Spark에서 내 서식 파일을 찾을 수 없습니다.

내 컨트롤러 :

public class HomeController : Controller 
    { 
     public ActionResult Index() 
     { 
      return View("~/Views/Account/Index"); 
     } 
    } 

그러나 스파크는 다음과 같은 오류 제공 :

The view '~/Views/Account/Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: 
Home\~/Views/Account/Index.spark 
Shared\~/Views/Account/Index.spark 
Home\~/Views/Account/Index.shade 
Shared\~/Views/Account/Index.shade 

은 왜 내가 그것을 절대 상대 경로를 준 것을 깨닫게하지 않습니다?

답변

1

Why doesn't it realise that I've given it an absolute relative path?

아마도 상대 절대 경로 같은 것이 없기 때문일 것입니다. 그러나 그 점 옆에 있습니다 ....

올바른 경로를 지정하지 않았습니다. 보기로의 경로를 지정할 때, 끝에 .spark가 있다고 가정 한 전체 이름을 포함해야합니다. ... 그것은 불꽃처럼 보이는

은 전방을 이해하는 것은 슬래시하지 않을 수 있으므로 반전 시도 :

return View("~/Views/Account/Index.spark"); 

편집 : 그래서 당신은이 작업을 수행 할 것

return View(@"~\Views\Account\Index.spark"); 
+0

같은 오류 만에를 ... 'Home \ ~/Views/Index.spark.spark' –

+0

@IanWarburton - 업데이트보기 –

+0

다시 한번. 그것은 경로의 시작 부분에 컨트롤러의 이름을 추가하는 것으로 결정됩니다. –

관련 문제