Cannot bind source content type Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent to model content type Umbraco.Web.PublishedContentModels.Home.
Can you let us know what your master page is inheriting from please?
It may be worth removing the call to the @Html.CachedPartial for rendering the Meta data as I little surprised that line is trying to bind your object to Umbraco.Web.PublishedContentModels.Home.
One other change would be instead of passing the Model.Content instead just pass Model.
and you're still getting the error then I suspect the error maybe somewhere else in Master page. From the error message what I suspect is happening is that somewhere the master page you're trying to render a partial which is inheriting from Home. From MasterPage this wouldn't be possible as the page template could be anything.
Hi Andy thanks for helping me
I think its this in @inherits Umbraco.Web.Mvc.UmbracoTemplatePage masterpage that generating the errror but in masterpage ihave a lot of doctypes.
I get the error from masterpage the errormessage Home because I'm on homepage if i go to a Contentpage
I get this error
Cannot bind source content type Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent to model content type Umbraco.Web.PublishedContentModels.ContentPage.
I have include the doctype on page and generated the model and attatched webconfig. The strange the intellicense in VS works and its no error.
If i use this code it work
I think you're correct, I've tried something similar in one of my projects and get a similar error.
The issue is (I think) in the Master Page you've got to inherit from UmbracoTemplatePage (or one of the similar classes), the code then can't at runtime bind to the MetaData class because you're using one of the base classes.
Somebody more experienced from the community may be able to provide a better explanation.
Display properties in a partialview
Hi I need som help with displaying properies in a partialview on masterpage thanks Christina
And in my partail view
I get this error
Hi Christina,
Can you let us know what your master page is inheriting from please?
It may be worth removing the call to the @Html.CachedPartial for rendering the Meta data as I little surprised that line is trying to bind your object to Umbraco.Web.PublishedContentModels.Home.
One other change would be instead of passing the Model.Content instead just pass Model.
Andy
Hi Andy Thanks
I Have removed partial and only passing Model but i still get error
This is masterpage
/Christina
Hi Christina,
If you've removed the call to
and you're still getting the error then I suspect the error maybe somewhere else in Master page. From the error message what I suspect is happening is that somewhere the master page you're trying to render a partial which is inheriting from Home. From MasterPage this wouldn't be possible as the page template could be anything.
Andy
Hi Andy thanks for helping me I think its this in
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
masterpage that generating the errror but in masterpage ihave a lot of doctypes. I get the error from masterpage the errormessage Home because I'm on homepage if i go to a ContentpageI get this error
I have include the doctype on page and generated the model and attatched webconfig. The strange the intellicense in VS works and its no error. If i use this code it work
Hi Christina,
I think you're correct, I've tried something similar in one of my projects and get a similar error.
The issue is (I think) in the Master Page you've got to inherit from UmbracoTemplatePage (or one of the similar classes), the code then can't at runtime bind to the MetaData class because you're using one of the base classes.
Somebody more experienced from the community may be able to provide a better explanation.
Andy
is working on a reply...