Cannot bind source content type Umbraco.Web.PublishedModels.Contact to model type Umbraco.Web.PublishedModels.Home error
Hi
I'm quite new to Umbraco, c# and asp.net and i've run into this problem:
Cannot bind source content type Umbraco.Web.PublishedModels.Contact to model type Umbraco.Web.PublishedModels.Home.
Both view and content models are PureLive, with same version. The application is in an unstable state and should be restarted.
I've made a few pages on various test projects that worked fine.
On my current project i've just added a contact page and i get the error in the title when i try to access it. I'm following a Udemy course called "OK, Umbraco" and it works fine in his project.
It says the source error is coming from this line in my master template:
If I remove the Navigation partial the contact page renders, but it works fine on the home page and in another project on all the pages.
I don't understand why it's not working if contact and home are the same apart from the ContentModel which i believe is correct. I've done some searching on this error but it seems like each case is different and none matched my own.
I'd be incredibly grateful if anyone could help me! Feeling a little overwhelmed with how little I understand everything at the moment.
Cannot bind source content type Umbraco.Web.PublishedModels.Contact to model type Umbraco.Web.PublishedModels.Home error
Hi
I'm quite new to Umbraco, c# and asp.net and i've run into this problem:
I've made a few pages on various test projects that worked fine.
On my current project i've just added a contact page and i get the error in the title when i try to access it. I'm following a Udemy course called "OK, Umbraco" and it works fine in his project.
It says the source error is coming from this line in my master template:
Inside my Navigation.cshtml I have:
Home.cshtml (which works fine):
Contact.cshtml:
If I remove the Navigation partial the contact page renders, but it works fine on the home page and in another project on all the pages.
I don't understand why it's not working if contact and home are the same apart from the ContentModel which i believe is correct. I've done some searching on this error but it seems like each case is different and none matched my own.
I'd be incredibly grateful if anyone could help me! Feeling a little overwhelmed with how little I understand everything at the moment.
Thanks
Your navigation.cshtml expects a model of type Home, when you render the contact-page the model will be wrong.
You can change your navigation.cshtml to expect the default model IPublishedContent by changing your first line to:
Just drop the
Amazing, thank you so much! I've been having quite a rough day and this has improved it drastically :)
is working on a reply...