Copied to clipboard

Flag this post as spam?

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


  • Mani 11 posts 111 karma points
    Jun 12, 2021 @ 15:43
    Mani
    0

    Umbraco 9 - Block List rendering

    I'm trying to loop through the Block List using " @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block)", but I get an error "MVC1000: Use of IHtmlHelper.Partial may result in application deadlock. Consider using

    I tried " var partialPath = "BlockList/Components/" + data.ContentType.Alias; " but I get another error

    "ModelBindingException: Cannot bind source type Umbraco.Cms.Core.Models.Blocks.BlockListItem2[[Umbraco.Cms.Web.Common.PublishedModels.Slider, UmbracoProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Umbraco.Cms.Web.Common.PublishedModels.SliderSettings, UmbracoProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] to model type Umbraco.Cms.Core.Models.Blocks.BlockListItem2[[Umbraco.Cms.Web.Common.PublishedModels.Slide, UmbracoProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Umbraco.Cms.Web.Common.PublishedModels.SliderSettings, UmbracoProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]."

    Has anyone come across this issue or is there a different way of rendering Block lists?

    Thank you so much in adance,

    Mani

  • Benjamin Carleski 33 posts 294 karma points MVP c-trib
    Jun 25, 2021 @ 15:01
    Benjamin Carleski
    100

    You may want to adjust your build settings. MVC1000 is a warning on my machine rather than an error, as it doesn't prevent compilation, it just lets you know a problem may occur at runtime.

    Either way, I'd open a bug report at https://github.com/umbraco/Umbraco-CMS/issues to make sure the BlockListEditor (and probably the Grid as well) get updated to use whatever the ASP.NET Core best practice is for this.

  • Mani 11 posts 111 karma points
    Jun 25, 2021 @ 22:00
    Mani
    0

    I revisited my code and managed to get it working, although I am not entirely sure what exactily I did diferently, I think I I'll make a note of the issues I face and keep a record of how it gets resolved.

  • 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