0

I am new to sitecore. I am stuck in one issue. While browsing to a new sitecore item created like http://sc92/newpage I am getting the below error.

Error Rendering View: \Views\Layouts\Website\Default.cshtml: Error while rendering view: '\Views\Layouts\Website\Default' (model: 'Sitecore.Mvc.Presentation.RenderingModel, Sitecore.Mvc').Inner Exception: The partial view '\Views\Layouts\Website\Default' was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Sitecore/\Views\Layouts\Website\Default.cshtml ~/Views/Sitecore/\Views\Layouts\Website\Default.vbhtml ~/Views/Shared/\Views\Layouts\Website\Default.cshtml ~/Views/Shared/\Views\Layouts\Website\Default.vbhtml ~/Views/Sitecore/\Views\Layouts\Website\Default.aspx ~/Views/Sitecore/\Views\Layouts\Website\Default.ascx ~/Views/Shared/\Views\Layouts\Website\Default.aspx ~/Views/Shared/\Views\Layouts\Website\Default.ascx ~/views/renderers/\Views\Layouts\Website\Default.vbhtml ~/views/renderers/\Views\Layouts\Website\Default.cshtml

I have checked the default view in www.root, it's there inside C:\inetpub\wwwroot\sc92\Views\Layouts\Website. What else I am missing?

3
  • What is the Path value of the layout item in sitecore?
    – x3mxray
    Aug 1, 2020 at 18:55
  • You can try below solution: Copy the respective cshtml file into web/Views folder Oct 17, 2021 at 9:00
  • You can try below solution: Copy the respective cshtml file into website/Views folder Oct 17, 2021 at 9:00

1 Answer 1

2

I believe that you used backslash characters ** in Path field of your layout.

You should use forward slash characters instead /.

So your path field should be /Views/Layouts/Website/Default.cshtml:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.