In my site, homepage did not load. All other pages working fine. I used partial view in homepage to show banner images which are under media section. When I delete those images in content node, then homepage is loaded..If not it shows error like below,
Could you please share your code from the partial macro? It will make it easier to figure out why you're getting the above error. Perhaps you're missing a check or something like that.
Partial View did not work
In my site, homepage did not load. All other pages working fine. I used partial view in homepage to show banner images which are under media section. When I delete those images in content node, then homepage is loaded..If not it shows error like below,
Hi Thomas
Could you please share your code from the partial macro? It will make it easier to figure out why you're getting the above error. Perhaps you're missing a check or something like that.
/Jan
Hi Jan,
This is my code in Partial View.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var mediaFolderId = (int)CurrentPage.BannerMediaFolder;
}@if (mediaFolderId > 0)
{ var mediaFolder = Umbraco.TypedMedia(mediaFolderId);
var banners = mediaFolder.Children(x => x.DocumentTypeAlias == "Banner").ToList();
var count = 0;
var dscname = "";
@foreach (var banner in banners)
{if(count == 0)
{ dscname = "active" ; }
dscname = "";
count++; }
}
is working on a reply...