I'm sorry posting the same question twice in this forum, but I clicked the first attemt as solved. But it was a mistake.
My razor macros seems to fail after upgrade. Does anyone have an idea?
Here is error messages:
Error Loading Razor Script (file: [Razor]NavigationMain) 'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'Any' at CallSite.Target(Closure , CallSite , Object )
at ASP._Page_macroScripts_NavigationMain_cshtml.Execute() in d:\NET_Umbraco\st5_workcopy_net_Backup2012_11_13\Teleca_v5\macroScripts\NavigationMain.cshtml:line 25
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
Additional error message shows on the web where macros are supposed to render:
Error loading Razor Script NavigationMain.cshtml
'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'Any'
Might be worth posting up the script code - d:\NET_Umbraco\st5_workcopy_net_Backup2012_11_13\Teleca_v5\macroScripts\NavigationMain.cshtml as it is failing on line 25 but without being able to see line 25 it's going to be pretty hard to work out what the issue is.
True, but as I understand the error message after upgrading to 4.8 from 4.7.2, it's about the DynamicNodeList. Does it work in the same way as it did in previous versions?
Here is the code for my razor macro:
@using umbraco @using umbraco.MacroEngines
@inherits DynamicNodeContext @{ // Root Node var root = @Model.AncestorOrSelf(); var level = String.IsNullOrEmpty(Parameter.Level) ? 1 : int.Parse(Parameter.Level); var parent = @Model.AncestorOrSelf(level);
<ul id="mega-menu-1" class="mega-menu"> @*Add the class selected if the root node ID matches our current node ID in the for each loop*@ @{ var homeSelected = @Model.Level == 1 ? " class=\"selected\"" : string.Empty; } <!--<[email protected](homeSelected)><a href="@root.Url">@root.Name</a></li>--> @foreach (var item in parent.Children.Where("umbracoNaviHide != true && hideInMainNavi != true")) {
// Add the class selected if the currentpage or parent nodes (up the tree to the root) // ID matches our current node ID in the for each loop var selected = Array.IndexOf(Model.Path.Split(','), item.Id.ToString()) >= 0 ? " class=\"selected\"" : string.Empty; <li><a href="@item.Url"@Html.Raw(selected)>@item.Name</a>
@* if the current page has any children, where the property hidePageInNavigation is not True *@ @if (item.Children.Where("Visible").Any()) { @* Call our helper to display the children *@ @childPages(item.Children) } </li>
} </ul> }
@helper childPages(dynamic pages) { @* Ensure that we have a collection of pages *@ if (pages.Any()) { @* Get the first page in pages and get the level *@ var naviLevel = pages.First().Level;
@* Add in level for a CSS hook *@ <ul> @foreach (var page in pages.Where("umbracoNaviHide != true && hideInMainNavi != true")) { <li> <a href="@page.Url">@page.Name</a>
@* if the current page has any children, where the property hidePageInNavigation is not True *@ @if (page.Children.Where("Visible").Any()) { @* Call our helper to display the children *@ @childPages(page.Children) } </li> } </ul> } }
I'm not that deep into razor and different .net versions...I'm just going to add that if you run uComponents you should be aware of this guide by Lee Kelleher on how to ensure it won't break anything after upgrading to 4.8 since the MNTP is now part of the Umbraco core.
I upgraded the uComponent to version 5.1. That installation seemed to work out in a good way. Lee Kelleher deals with older versions of uComponent. But does this effect the using of DynamicNode?
Ups, sorry - read the posts wrong. Turns out it is not solved #h5is.
No I don't believe that uComponents is the issue here. Just wanted to make sure you knew about the potential issue. If I figure out something I will get back to you.
Please any body can explain me how to create a new website after the sample website is created(After installation of umbraco 4.10)
I get one sample website with starterkit and skin while installing the umbraco 4.10 and when i try to open the new website from template.It is not showing the admin session in the toolbar(which will navigate to the browser).
Please tell me how to create the new website similar to sample webiste which i got while installing the umbraco 4.9
Upgrade from 4.7.2 to 4.8 problem
I'm sorry posting the same question twice in this forum, but I clicked the first attemt as solved. But it was a mistake.
My razor macros seems to fail after upgrade. Does anyone have an idea?
Here is error messages:
Additional error message shows on the web where macros are supposed to render:
Jerker,
Might be worth posting up the script code - d:\NET_Umbraco\st5_workcopy_net_Backup2012_11_13\Teleca_v5\macroScripts\NavigationMain.cshtml as it is failing on line 25 but without being able to see line 25 it's going to be pretty hard to work out what the issue is.
Mark.
True, but as I understand the error message after upgrading to 4.8 from 4.7.2, it's about the DynamicNodeList. Does it work in the same way as it did in previous versions?
Here is the code for my razor macro:
Jerken,
So the .Any() seems to have gone - what about trying something like this instead:
Mark..
Seems like most of it is gone though. Even Count.
Seems like the upgrade have changed the DynamicNode
Jerker,
Can you run in debug and examine the DynamicNodeList at runtime? Should show you what methods you can call on it.
Mark.
Hi Jerker
I'm not that deep into razor and different .net versions...I'm just going to add that if you run uComponents you should be aware of this guide by Lee Kelleher on how to ensure it won't break anything after upgrading to 4.8 since the MNTP is now part of the Umbraco core.
/Jan
I upgraded the uComponent to version 5.1. That installation seemed to work out in a good way. Lee Kelleher deals with older versions of uComponent. But does this effect the using of DynamicNode?
Turns out Jerker found the solution in this post apparently? :) http://our.umbraco.org/forum/getting-started/installing-umbraco/36147-Upgrade-from-472-to-48-problem
/Jan
Ups, sorry - read the posts wrong. Turns out it is not solved #h5is.
No I don't believe that uComponents is the issue here. Just wanted to make sure you knew about the potential issue. If I figure out something I will get back to you.
/Jan
Hi Mark,
I have just had the same issue with Count on v4.11 but I changed it to Count()
i.e.
Hope that helps!
Kenny
Hi,
Please any body can explain me how to create a new website after the sample website is created(After installation of umbraco 4.10)
I get one sample website with starterkit and skin while installing the umbraco 4.10 and when i try to open the new website from template.It is not showing the admin session in the toolbar(which will navigate to the browser).
Please tell me how to create the new website similar to sample webiste which i got while installing the umbraco 4.9
Thanks & Regards..
B.Sheshu kumar
is working on a reply...