I'm developing a website in Umbraco 4.11.1 and I have come across several errors:
Problem 1: When using:
@foreach (var page in Model.Content.AncestorsOrSelf(1))
I get the following error:
Compiler Error Message: CS1928: 'Umbraco.Web.Models.RenderModel' does not contain a definition for 'AncestorsOrSelf' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.AncestorsOrSelf(Umbraco.Core.Models.IPublishedContent, string)' has some invalid arguments
Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
var image = new DAMP.PropertyEditorValueConverter.Model(item.GetPropertyValue("afbeelding"))
I get the following error:
Compiler Error Message: CS1502: The best overloaded method match for 'DAMP.PropertyEditorValueConverter.Model.Model(string)' has some invalid arguments
To fix it I need to format the Razor code as:
var image = new DAMP.PropertyEditorValueConverter.Model(item.GetPropertyValue<int>("afbeelding").ToString())
Also, when the "afbeelding" property has no value, Count() still returns 1. But the DAMP_Item object in the list is empty.
Problem 4:
It seems like the Random(int) method on IPublishedContent is missing?
Is something wrong with my Umbraco installation or is it me doing something wrong?
I had a similar problem (I think) where I couldn't sort on my properties within Razor scripts.
for example: .OrderBy("myUmbracoProperty desc")
This worked in 4.9, but not after I upgrated to 4.11 :P
After quite alot of hairpulling I tried to re-save my document type (which has the property), which resulted in a server error (ysod). I then tried to save it again (this time from the server, might have worked remotely).
Now I can sort by my property.
However I have to make sure I ONLY select nodes that DO have the (sorting) property, this wasn't a problem before (and is still causing me issues) :P
NB:
I also noticed that I could sort by properties on some other document types.
My have set up a little complicated document type structure, the problem DT was on level 3, that is it was a descendant of 2 other DTs
Several Razor problems in 4.11.1
Hey all,
I'm developing a website in Umbraco 4.11.1 and I have come across several errors:
Problem 1: When using:
I get the following error:
Problem 2: When using:
I get the following error:
To fix it I need to format the Razor code as:
Problem 3: When using:
I get the following error:
To fix it I need to format the Razor code as:
Also, when the "afbeelding" property has no value, Count() still returns 1. But the DAMP_Item object in the list is empty.
Problem 4:
It seems like the Random(int) method on IPublishedContent is missing?
Is something wrong with my Umbraco installation or is it me doing something wrong?
Kind regards,
Niek
I have the same errors. Have you managed to solve it Niek?
I haven't managed to solve it yet...
Maybe someone else could help us?
I had a similar problem (I think) where I couldn't sort on my properties within Razor scripts.
for example: .OrderBy("myUmbracoProperty desc")
This worked in 4.9, but not after I upgrated to 4.11 :P
After quite alot of hairpulling I tried to re-save my document type (which has the property), which resulted in a server error (ysod). I then tried to save it again (this time from the server, might have worked remotely).
Now I can sort by my property.
However I have to make sure I ONLY select nodes that DO have the (sorting) property, this wasn't a problem before (and is still causing me issues) :P
NB:
Hope this helps...
is working on a reply...