Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Johansson 1 post 21 karma points
    Feb 13, 2013 @ 22:20
    Christian Johansson
    0

    Umbraco 6 RenderBody

    Hi, Im new to Umbraco

    I donĀ“t understand how Templeting works

    If I have only one template, can it has RenderBody or RenderSection?

    In MVC you have the template and the Content defines @Section TheSection{} and things that are not defined in a section gets into RenderBody.

    I thought Umbraco worked lite that, the Template has RenderSection("TheSection",false) and if the DocumentType has an property TheSection that content is displayed in RenderSection("TheSection",false).

    But this seems not to be the case. If I create Content with a template that has RenderBody I get the following exception 

    The file "~/Views/Layout.cshtml" cannot be requested directly because it calls the "RenderBody" method.

    Does that meen that a Content can only use templates that has no RenderSection or RenderBody?

    And the template has to use @Model.Content.GetPropertyValue("TheSection")???

     

     

Please Sign in or register to post replies

Write your reply to:

Draft