Getting error "'bool' does not contain a definition for 'Content'" in a partial view trying to output data from an Umb Core MNTP (alias "articleList") using:-
You got me thinking, if you want to, your partial can inherit from UmbracoTemplatePage instead of UmbracoViewPage, then your code can be the same within the partial as it is in the View.
Error exposing MNTP data in V6.1.1 MVC
Getting error "'bool' does not contain a definition for 'Content'" in a partial view trying to output data from an Umb Core MNTP (alias "articleList") using:-
This is taken from http://our.umbraco.org/documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors/Multi-Node-Tree-Picker but changing the @using Umbraco.Core.Dynamics; for @inherits Umbraco.Web.Mvc.UmbracoViewPage<dynamic>
This is my first MVC site so I'm slowly adjusting to the new API and syntax, which I'm enjoying.
Any advice appreciated.
Cheers,
Craig
Hey again,
When you render this partial what model do you pass?
Thanks,
Jeavon
This is how I do it, which works perfectly.
My partial:
There you have me, I don't really know.
It's rendered in the home page (home.cshtml) with @inherits Umbraco.Web.Mvc.UmbracoTemplatePage using @Html.Partial("HomePageArticleList",false).
Does that tell you?
Craig
Ah, our posts crossed. Altered my code to yours and it worked perfectly:) I'll pick the changes out of it to work out what's going on.
Many thanks,
Craig
Excellent! Main difference is just passing Model.Content as the Model to the partial
You got me thinking, if you want to, your partial can inherit from UmbracoTemplatePage instead of UmbracoViewPage, then your code can be the same within the partial as it is in the View.
e.g
Sorry, one last thought for you, have you seen this package? http://our.umbraco.org/projects/developer-tools/umbraco-core-property-editor-converters
Then you would not even need to use this code to process the string values, instead you would just go
is working on a reply...