Help! 'Cannot render a macro when there is no current PublishedContentRequest.'
The short story is I have a list of blog articles which I'm casting to a model which contains .wordCount. This is calculated by striping the HTML from the output of the RTE and then calculating the lengh. The output of the RTE can contain Macros.
On first load, i.e from a view, I have no problems. However, when I refresh my list articles using a clientside AJAX call I get an exception on function to strip the HTML from the output of the RTE. The error I get is System.InvalidOperationException: 'Cannot render a macro when there is no current PublishedContentRequest.'I have included a snippet of my code below. I suspect this is something simple and to do with how my IPublishedContent is treated when called from AJAX opose to complied in the view.
Help! 'Cannot render a macro when there is no current PublishedContentRequest.'
The short story is I have a list of blog articles which I'm casting to a model which contains
.wordCount
. This is calculated by striping the HTML from the output of the RTE and then calculating the lengh. The output of the RTE can contain Macros.On first load, i.e from a view, I have no problems. However, when I refresh my list articles using a clientside AJAX call I get an exception on function to strip the HTML from the output of the RTE. The error I get is
System.InvalidOperationException: 'Cannot render a macro when there is no current PublishedContentRequest.'
I have included a snippet of my code below. I suspect this is something simple and to do with how myIPublishedContent
is treated when called from AJAX opose to complied in the view.My Code
Thanks in advanace
is working on a reply...