I have looked into your code the only thing that I think that´s wrong with your code is that you have the @ in front of your if statments. You are in a foreach loop, so the Razor engine is started, so to say.
So try this snippet of code and see if it works for you.
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var sliderItems = Umbraco.Content(5021); var magazineLevel = CurrentPage.DescendantsOrSelf("Magazine").OrderBy("magazineDate desc, magazineDate"); var latestMagazine = magazineLevel.Take(1);
Good it got solved - As mentiond in my initial comment you can always check the trace-log to get some more useful descriptions of the error messages so you may be able to figure it out next time by having a look :)
Trying to fix this razor view
Hey guys,
Im having some trouble getting this code to work. Can anyone see why its not working?
Hi Nicolai
Could you please check the /App_Data/Logs file and see if anything marked with ERROR provides some more useful information about the error?
And does Visual Studio provide any hints about the issue if you're a VS guy?
/Jan
Hi Nicolai,
I have looked into your code the only thing that I think that´s wrong with your code is that you have the @ in front of your if statments. You are in a foreach loop, so the Razor engine is started, so to say.
So try this snippet of code and see if it works for you.
/Dennis
You're right Dennis. I totally blanked out on that one :) Thanks alot!
Hi Nicolai
Good it got solved - As mentiond in my initial comment you can always check the trace-log to get some more useful descriptions of the error messages so you may be able to figure it out next time by having a look :)
Have a nice day.
/Jan
is working on a reply...