it looks like you have two models passed as the page model to the same view. The error message states that you're trying to use both CsapatElem and Masterpage and the page model can only be one of these.
This is usually due to template inheritance (look at the top of your templates), where two templates use different models. Typically you want your Masterpage to be generic (which means it can use any model and then your document type specific template to have a strong model declaration.
So, if I'm guessing correctly you want the beginning of your templates to look like this:
With the above your masterpage will work with all child templates and the child template has strongly typed page model. I have no idea if that is actually the name of your templates but hope it makes sense ☺
No idea what happened
Hi Nso,
it looks like you have two models passed as the page model to the same view. The error message states that you're trying to use both
CsapatElem
andMasterpage
and the page model can only be one of these.This is usually due to template inheritance (look at the top of your templates), where two templates use different models. Typically you want your Masterpage to be generic (which means it can use any model and then your document type specific template to have a strong model declaration.
So, if I'm guessing correctly you want the beginning of your templates to look like this:
Masterpage.cshtml:
CsapatElem.cshtml:
With the above your masterpage will work with all child templates and the child template has strongly typed page model. I have no idea if that is actually the name of your templates but hope it makes sense ☺
All the best
Rune
Thanks!
is working on a reply...