Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I am trying to create an umbraco template which refers _Layout. But it gives below error when I refer _Layout.cshtml.
Cannot bind source content type Brightwater.Application.Models.Umbraco.FAqitem to model content type Brightwater.Application.Models.Umbraco.Base.
Any help would be really appreciated.
Thanks!
Hi Dan,
Does your layout FAqitem model inherits from the Base model
Dave
Thanks for your reply. No it inherits from PublishedContentModel
Than that's the issue. You configured your layout to use a specific model.
But your view is using a model that does not match.
yup - I need to create a template page with same layout. Can you please let me know how can I achieve that ?
Are you using your Base model in your _Layout ?
Otherwise you could just define your layout with out a type specification
@inherits UmbracoViewPage
Yes I am using Base model in the layout.
Since I am using the model inside the layout. Do you think you suggestion would work ?
This will probably always give errors. Because the @Model.Content.SchemaType is coming from your base model. But your FAqitem will not have this property.
Yup - but there should be a way to create a template with layout. isnt it ? Any help would be really appreciated.
I was able create a template with layout when I inherited base class in the template document type.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Refer layout from custom template
Hi,
I am trying to create an umbraco template which refers _Layout. But it gives below error when I refer _Layout.cshtml.
Cannot bind source content type Brightwater.Application.Models.Umbraco.FAqitem to model content type Brightwater.Application.Models.Umbraco.Base.
Any help would be really appreciated.
Thanks!
Hi Dan,
Does your layout FAqitem model inherits from the Base model
Dave
Thanks for your reply. No it inherits from PublishedContentModel
Than that's the issue. You configured your layout to use a specific model.
But your view is using a model that does not match.
Dave
yup - I need to create a template page with same layout. Can you please let me know how can I achieve that ?
Are you using your Base model in your _Layout ?
Otherwise you could just define your layout with out a type specification
Yes I am using Base model in the layout.
Since I am using the model inside the layout. Do you think you suggestion would work ?
Hi Dan,
This will probably always give errors. Because the @Model.Content.SchemaType is coming from your base model. But your FAqitem will not have this property.
Dave
Yup - but there should be a way to create a template with layout. isnt it ? Any help would be really appreciated.
Thanks!
I was able create a template with layout when I inherited base class in the template document type.
is working on a reply...