Copied to clipboard

Flag this post as spam?

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


  • Kyle 24 posts 63 karma points
    Oct 02, 2014 @ 09:45
    Kyle
    0

    Can't access bodyText RTE value - Cannot render a macro when there is no current PublishedContentRequest.

    Hi,

    I'm using ajax to request a list of nodes from a surface controller. It works however when I try to render the bodyText RTE value in the returned partial view it throws the error:

    Cannot render a macro when there is no current PublishedContentRequest.

    What am I missing / doing wrong?

    @inherits UmbracoTemplatePage
    @using Umbraco.Core;  
    @{
        var nodes = (IEnumerable<IPublishedContent>)ViewBag.nodes;
        if (nodes.Count() > 0)
        { 
            foreach (var node in nodes)
            {
                @node.Name
                @node.AsDynamic().pageTitle
                @node.AsDynamic().bodyText
                @node.UrlName
            }
        }
    }
    

    Thanks,
    Kyle

Please Sign in or register to post replies

Write your reply to:

Draft