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?
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.
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.
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.BlockListItem
2[[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.BlockListItem
2[[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
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.
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.
is working on a reply...