Trying to learn Razor, now that XSLT have been decapitated. I am making a fairly simple navigation and would like to check for the last element in my foreach using the IsNotLast:
@lvl.IsNotLast("|") is giving me an error frontend: Error loading Razor Script green_solutionFooterLinksRZ.cshtml
Cannot invoke a non-delegate type
I can go with the out commented section, wit the if condition, the other option just seems smarter. But what is wrong, why am I getting an error? Site is Umbraco 4.7.1
I was not aware that this would be a valid call.. but, I've just tested it and it seems to work fine! I think you're using 4.7.0, you should upgrade to 4.7.1 to use the IsHelpers. :)
IsHelpers not working?
Hi
Trying to learn Razor, now that XSLT have been decapitated. I am making a fairly simple navigation and would like to check for the last element in my foreach using the IsNotLast:
@{var footerLinks = Model.NodeById(1214).Children;}
<ul>
@foreach(var lvl in footerLinks)
{
if(lvl.HasAccess){
<li>
<a href="@lvl.Url">@lvl.Name</a>
@lvl.IsNotLast("|")
@*@if(lvl != footerLinks.Last()){
<text>|</text>
}*@
</li>
}
}
</ul>
@lvl.IsNotLast("|") is giving me an error frontend: Error loading Razor Script green_solutionFooterLinksRZ.cshtml
Cannot invoke a non-delegate type
I can go with the out commented section, wit the if condition, the other option just seems smarter. But what is wrong, why am I getting an error? Site is Umbraco 4.7.1
I was not aware that this would be a valid call.. but, I've just tested it and it seems to work fine! I think you're using 4.7.0, you should upgrade to 4.7.1 to use the IsHelpers. :)
is working on a reply...