'IPublishedContent' does not contain a definition for 'Content' and no accessible extension method 'Content' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Well, maybe I am, but I do not know which one.
I read somewhere, that I do not need to add .Content in U8, but then I get
You need to figure out what model you are trying to render. Umbraco is telling you that you are trying to render a model that does not have the "contentGrid" property.
How is that view being used? What model are you passing on to it etc. ?
Render grid in Umbraco 8
I simply cannot get the grid to render in Umbraco8, and I do not know why.
I have a page with a grid on it with the alias "contentGrid"
I have a template file like this:
As documented here https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/render-grid-in-template
But I get a
'IPublishedContent' does not contain a definition for 'Content' and no accessible extension method 'Content' accepting a first argument of type 'IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
Well, maybe I am, but I do not know which one.
I read somewhere, that I do not need to add .Content in U8, but then I get
No property type found with alias contentGrid
What to do?
Hi,
You need to figure out what model you are trying to render. Umbraco is telling you that you are trying to render a model that does not have the "contentGrid" property.
How is that view being used? What model are you passing on to it etc. ?
Okay, I was trying to make the example clearer, and stumbled upon the solution. Thanks you Søren, for prompting me to do that.
For future reference, I was missing a line, so the correct example should look like this:
It looks like "
Hi Allan
Remember in Umbraco 8 the
RenderModel
has been removed and simplified, so there is no longerModel.Content
justModel
.I guess we now could have a property with alias
content
and access it usingModel.Content
using ModelsBuilder, which in v7 would cause collisions./Bjarne
Thank you very much! Documentation's seems to be outdated and I've created related issue.
is working on a reply...