@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
<div class="title">Test</div>
<ul>
@{
var ow = @owCore.Initialise(1085);
var node = Umbraco.Content(1105);
foreach (var item in node
.Children.Where("Visible")
.OrderBy("Id descending")
.Take(5)
)
{
<li><a href="@item.Url">@item.pageTitle</a></li>
}
}
</ul>
The error I get is
Compiler Error Message: CS1513: } expected
Source Error:
Line 113: }
Line 114: }
Line 115:}
Clear looks like too few closing '}'
Presumably the div forces the closing }?
I have checked owCore (it's a library of functions I am building in App_Code : however, I have stripped this back and it's now doing nothing
just to make sure there are matched curly brackets:
@using Umbraco
@using Umbraco.Core.Models
@using Umbraco.Web
@functions{
public static int Initialise(int siteDocID){
return 0;
}
}
However, if I remove the @owCore code from the partial view
Problem with matching { and }
I am using a partial view to list the top 5 children of a specific node.
This works, but only if I put a div before the
eg
produces the expected unsorted list.
However, if I remove the empty div
The error I get is
Compiler Error Message: CS1513: } expected
Source Error:
Line 113: } Line 114: } Line 115:}
Clear looks like too few closing '}'
Presumably the div forces the closing }?
I have checked owCore (it's a library of functions I am building in App_Code : however, I have stripped this back and it's now doing nothing just to make sure there are matched curly brackets:
However, if I remove the @owCore code from the partial view
All is ok again.
Does that mean it's definitely an issue with the owCore or simply something else tripping the issue with mismatched {}
I have checked the template calling this partial view and can't find a problem.
This doesn't make sense. Can anyone explain?
Thanks!
Solved thanks to reply to another post.
don't need the @ in @owCore as this causes a new block to start!
Awesome Tim. I´ll post the Url to the other thread, in case someone has the same issue in the future and wants to find the solution quicker:
https://our.umbraco.org/forum/templates-partial-views-and-macros/77396-syntax-of
is working on a reply...