Copied to clipboard

Flag this post as spam?

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


  • J 351 posts 606 karma points
    Mar 13, 2018 @ 15:52
    J
    0

    Cannot bind source type Umbraco.Web.Models.PartialViewMacroModel to model type Umbraco.Core.Models.IPublishedContent.

    I have created a Partial View which resides inside a Macro.

    When i add the macro to my webforms template i get the error

    "Cannot bind source type Umbraco.Web.Models.PartialViewMacroModel to model type Umbraco.Core.Models.IPublishedContent."

    If i add just the MVC code then it displays the text only and doesnt render anything?

    Could someone advise how to come over this issue?

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Mar 13, 2018 @ 15:55
    Alex Skrypnyk
    0

    Hi J

    How did you add the macro to your template? can you show the razor code?

    Thanks,

    Alex

  • J 351 posts 606 karma points
    Mar 13, 2018 @ 15:59
    J
    0

    Hey Alex,

    Thanks for your help! I go into Developer > Partial view macro files > Then created my PVM file. This also created a Macro which links to this PVM file. I then insert the macro on the template.

    This is a snippet of what i have inside this file

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using Skybrud.Social.Instagram
    @using Skybrud.Social.Instagram.Objects
    @using Skybrud.Social.Instagram.Responses
    @using Skybrud.Social.Umbraco.Instagram.PropertyEditors.OAuth
    @inherits Umbraco.Web.Mvc.UmbracoViewPage
    
    @{
    ....
    

    Thanks

  • Alex Skrypnyk 5908 posts 22603 karma points MVP 4x admin c-trib
    Mar 13, 2018 @ 17:31
    Alex Skrypnyk
    0

    How did you add macro to a template?

  • J 351 posts 606 karma points
    Mar 13, 2018 @ 21:35
    J
    0

    I used the menu at the top of the editor and clicked insert macro and selected the macro that was created when I created the Partial view file. It wasn't using the @HTML.render("pvfileName") code as it only displayed this as text so i used the usual insert macro??

  • 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