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
I was trying to save this simple navigation
<nav><ul> @{ var homeNode = Model.AncestorOrSelf("Home");} <li> <a href="@homeNode.Url">@homeNode.Name</a> </li> @foreach (var page in homeNode.Children.Where("Visible")) { <li> <a href="@page.Url">@page.Name</a> </li> }</ul> @if (page.Children.Where("Visible").Count() > 0) { <ul> @foreach (var childPage in page.Children.Where("Visible")) { <li><a href="@childPage.Url">@childPage.Name</a></li> } </ul> }</ul></nav>
But i got this error Saving scripting file failed: d:\_produktion\techcollege.dk\MacroScripts\635221987629512119_Navigation.cshtml(40): error CS0135: 'page' conflicts with the declaration 'umbraco.page'
Your code:
@if (page.Children.Where("Visible").Count() > 0)
Is outside of the foreach loop that sets the page variable, which is why you get this error
thaks silly me !
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error saving scripting files
I was trying to save this simple navigation
But i got this error
Saving scripting file failed: d:\_produktion\techcollege.dk\MacroScripts\635221987629512119_Navigation.cshtml(40): error CS0135: 'page' conflicts with the declaration 'umbraco.page'
Your code:
Is outside of the foreach loop that sets the page variable, which is why you get this error
thaks silly me !
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.