2016-06-16 55 views
-1

我們有一個頁面上有各種渲染。此頁面間歇性加載。有一天,它將毫無問題地工作,並且有一天它會完全停止工作。當它完全停止工作時,問題是Sitecore渲染沒有間歇性發現

Exception: System.InvalidOperationException 
    Message: The view 'renderingname.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched: 
~/Views/News/renderingname.aspx 
~/Views/News/renderingname.ascx 
~/Views/Shared/renderingname.aspx 
~/Views/Shared/renderingname.ascx 
~/Views/News/renderingname.cshtml 
~/Views/News/renderingname.vbhtml 
~/Views/Shared/renderingname.cshtml 
~/Views/Shared/renderingname.vbhtml 

該路線已在OOTB路線之前正確註冊。頁面上的其他視圖永遠不會有這個問題,它與rendername.cshtml位於同一個目錄中。

這裏是沒有的型號代碼運行此組件的控制器代碼 -

public ActionResult GetComponent() 
{ 
    //code to populate the model 

    return View("renderingname", model); 
} 

關於如何解決此問題的任何想法?

+0

您使用的控制器的渲染?你能告訴我你的行動的代碼返回視圖嗎? –

+0

是使用控制器渲染。我稍後會發布代碼。 – Gabbar

+0

我更新了代碼。 – Gabbar

回答

0

提供的完整路徑爲您呈現:

public ActionResult GetComponent() 
{ 
    //code to populate the model 
    return View("~/Views/Your_View_Folder/renderingname.cshtml",model); 
}