I'm trying to hide a wrapping panel (div) if the contained cmslistmenu item has no items in it. I've set the property for 'HideControlForZeroRows' to true for the cmslistmenu and this seems to be showing and hiding as expected.In my code behind (.aspx.cs) I have the following logic in the pageLoad event:if (subNavigation.Visible == false)
subNavigationWrapper.Visible = false;
However the subnavigation wrapper always shows regardless of the visibility of the 'subNavigation'. Is there an approach for this that would work? The whole code block looks something like this:@asp:Panel ID=@subNavigationWrapper@ runat=@server@ CssClass=@sub-navigation--wrapper@ Visible=@true@@
@div class=@inner@@
@div class=@sub-navigation@@
@span class=@breadcrumb@@@cms:CMSBreadCrumbs ID=@CMSBreadCrumbs1@ runat=@server@ /@@/span@
@div class=@sub-navigation-nav@@
@cms:listmenu runat=@server@ ID=@subNavigation@ WhereCondition=@MenuItemGroup LIKE 'subnav'@ Path=@./%@ MaxRelativeLevel=@4@ RenderCssClasses=@false@ HideControlForZeroRows=@true@ ZeroRowsText=@@ CacheDependencies=@##DEFAULT##@ /@
@/div@
@/div@
@/div@
@/asp:Panel@
↧