Hello guys, I'm having an issue when previewing my web page. I'm setting up a little blog section in my website and for this i have 2 Doc Types: Blog and Blog Article. Both have they're respective templates. I'm also using the Models Builder in Api mode to generate my models and therefore accessing the properties I need.
When I try to preview the Blog section of my site, it gives me the following error message :
Cannot bind source content type Agap2IT.RD.BlockBase.Website.Models.Blog to model content type Agap2IT.RD.BlockBase.Website.Models.BlogArticle
I'm using the following instructions in the Blog template:
The Blog Doc Type has BlogArticles as its children, as it's natural, and in its template I simply create a List of BlogArticles and iterate over them to access their properties (as shown below)
Bind source content type error message
Hello guys, I'm having an issue when previewing my web page. I'm setting up a little blog section in my website and for this i have 2 Doc Types: Blog and Blog Article. Both have they're respective templates. I'm also using the Models Builder in Api mode to generate my models and therefore accessing the properties I need. When I try to preview the Blog section of my site, it gives me the following error message :
Cannot bind source content type Agap2IT.RD.BlockBase.Website.Models.Blog to model content type Agap2IT.RD.BlockBase.Website.Models.BlogArticle
I'm using the following instructions in the Blog template:
The Blog Doc Type has BlogArticles as its children, as it's natural, and in its template I simply create a List of BlogArticles and iterate over them to access their properties (as shown below)
Any thoughts on what i'm doing wrong? Thank you in advance :)
Hi Goncalo.
In your Blog Template (Blog.cshtml?), Replace this line:
With this line:
Your trying to convert your Blog Doctype to a BlogArticle, which is not the same doctype.
Replacing the above line should fix your binding issue.
Best of luck to you my friend!
Thank you very much for your help Dennis :) great community in here!
Glad to help Goncalo!! Have a great day!
is working on a reply...