Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
During implementation of following method for Creating Dynamic Navigation Menu using Umbarco V8 -- Getting attached error so please suggest . Thanks and waiting response from experts....
===============================================
private List NavigationListItem GetChildNavigationList(dynamic page) { ListNavigationListItem listItems = null; **var childPages = page.Children.Where("Visible");** if (childPages != null && childPages.Any() && childPages.Count() > 0) { listItems = new ListNavigationListItem(); foreach (var childPage in childPages) { NavigationListItem listItem = new NavigationListItem(new NavigationLink(childPage.Url, childPage.Name)); listItem.Items = GetChildNavigationList(childPage); listItems.Add(listItem); } } return listItems; }
Hi Noor
Do not use dynamic type
Alex
Thanks Alex,
Then which data type needs to be use inested of dynamic kindly suggest.
Try to use IPublishedContent
And this is not datatype
Not getting where i need to use "IPubloshedContent"
Your code would be better like this:
private List<NavigationListItem> GetChildNavigationList(IPublishedContent page) { ListNavigationListItem listItems = null; var childPages = page.Children.Where(x => x.IsVisible()); if (childPages != null && childPages.Any() && childPages.Count() > 0) { listItems = new ListNavigationListItem(); foreach (var childPage in childPages) { NavigationListItem listItem = new NavigationListItem(new NavigationLink(childPage.Url, childPage.Name)); listItem.Items = GetChildNavigationList(childPage); listItems.Add(listItem); } } return listItems; }
Great Alex.......... Thanks Working now.
Alex ...Can you please help for below issue ... please suggest solution...
https://our.umbraco.com/forum/umbraco-8/98846-umbraco-does-not-exist-in-the-current-context#comment-311374
It's midnight at my place, I will have a look tomorrow.
Sure ... Thanks
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
RuntimeBinderException: 'object' does not contain a definition for 'Where'
Hi,
During implementation of following method for Creating Dynamic Navigation Menu using Umbarco V8 -- Getting attached error so please suggest . Thanks and waiting response from experts....
===============================================
Hi Noor
Do not use dynamic type
Alex
Thanks Alex,
Then which data type needs to be use inested of dynamic kindly suggest.
Try to use IPublishedContent
And this is not datatype
Not getting where i need to use "IPubloshedContent"
Your code would be better like this:
Great Alex.......... Thanks Working now.
Alex ...Can you please help for below issue ... please suggest solution...
https://our.umbraco.com/forum/umbraco-8/98846-umbraco-does-not-exist-in-the-current-context#comment-311374
It's midnight at my place, I will have a look tomorrow.
Sure ... Thanks
is working on a reply...