Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • J. de K. 9 posts 89 karma points
    Aug 23, 2022 @ 11:58
    J. de K.
    0

    Umbraco.Web.Mvc.ModelBindingException: Cannot bind source content type

    I am getting this error and having a hard time fixing it.

    Umbraco.Web.Mvc.ModelBindingException: Cannot bind source content type [redacted].Web.ViewModels.PageNotFound to model type [redacted].Web.ViewModels.Subpage.

    The error arises when trying to load a 404 error page of document type 'Errorpage'. I am new to Umbraco so I am not entirely sure how to decode the message, but googling suggests that it may be because of this line in /Views/Subpage.cshtml?

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<[redacted].Web.ViewModels.Subpage> @using ContentModels = Umbraco.Web.PublishedModels

    Anyone knows what may be the issue?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 10x admin c-trib
    Aug 24, 2022 @ 11:59
    Dave Woestenborghs
    0

    Hi

    I guess you are trying to reuse the template for SubPage document type on the PageNonFound document type.

    Is that correct ?

    Dave

  • J. de K. 9 posts 89 karma points
    Aug 24, 2022 @ 12:27
    J. de K.
    0

    I think that is correct yes, although I don't quite know where it states that PageNotFound should use the SubPage template. I have inherited this code base and this is my first exposure to Umbraco :/

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies