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
Why does this code does not work anymore since uQuery get part of the core?
I also removed any namespace-reference to uComponent, but I does not work anymore since version 4.8
Error says:
'umbraco.NodeFactory.Node' does not contain a definition for 'GetPropertyAsString'
var siteHomeNode = uQuery.GetRootNode().GetChildNodes().FirstOrDefault(node => node.GetPropertyAsString("alias") == "Home");
Hi Thomas,
I think those methods have been replaced by the generic method: GetProperty<string>("alias")
Hope this helps,Tom
Thank you Tom.
This gets me one step ahead to the next error. :-)
Says:
error CS1502: The best overloaded method match for 'System.Tuple.Create(object, int)' has some invalid arguments
Error occurs in this line:
<a href='@child.GetProperty<String>("destination")' @Html.Raw(child.GetProperty<Boolean>("newwindow") ? "target=\"_blank\"" : "")>@child.Name</a>
Any idea what this means?
Ok, just fixed it by myself doing this:
var url = child.GetProperty<String>("destination");
<a href='@url' @Html.Raw(child.GetProperty<Boolean>("newwindow") ? "target=\"_blank\"" : "")>@child.Name</a>
Thank you for the essential hint!
You got it - Razor trips up with the <> signs. Another way to get around it is to wrap in parens:
<a href='@(child.GetProperty<String>("destination"))'> ... </a>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
uQuery GetPropertyAs issue
Why does this code does not work anymore since uQuery get part of the core?
I also removed any namespace-reference to uComponent, but I does not work anymore since version 4.8
Error says:
'umbraco.NodeFactory.Node' does not contain a definition for 'GetPropertyAsString'
Hi Thomas,
I think those methods have been replaced by the generic method: GetProperty<string>("alias")
Hope this helps,
Tom
Thank you Tom.
This gets me one step ahead to the next error. :-)
Says:
error CS1502: The best overloaded method match for 'System.Tuple.Create(object, int)' has some invalid arguments
Error occurs in this line:
<a href='@child.GetProperty<String>("destination")' @Html.Raw(child.GetProperty<Boolean>("newwindow") ? "target=\"_blank\"" : "")>@child.Name</a>
Any idea what this means?
Ok, just fixed it by myself doing this:
var url = child.GetProperty<String>("destination");
<a href='@url' @Html.Raw(child.GetProperty<Boolean>("newwindow") ? "target=\"_blank\"" : "")>@child.Name</a>
Thank you for the essential hint!
You got it - Razor trips up with the <> signs. Another way to get around it is to wrap in parens:
is working on a reply...