Strange node object property behaviour, observed through VS debug
Hi,
I'm experiencing quite a strange behaviour interactiong with node, it's parent node and that (parent) node's NiceUrl.
I'm querying Umbraco for the current node's parent node, wich works just fine.
Then I want to get that parent node's NiceUrl, to navigate down to it (this is a sport of a back button functionality).
The resulting parent node is not the root of the website (wich is as expected).
I'm trying to go from /parent/somenode to /parent.
However.. when I ask for the parent node's NiceUrl (C#: parent.NiceUrl) it results in "#", and umbraco gives me the friendly (ugly) 404 message when I do a Responce.Redirect(parent.NiceUrl).
The strange thing is, when I step through the execution (using Debug-Attache to process) I see when .NET thinks that the NiceUrl of the parent node is "#". BUT, if I expand the parent object, and explore the NiceUrl property (during debugging) it results in the correct path!
See picture, same property from two different views:
So, if I debug the code, and view the property (while hovering with the mouse in the code view), the code will work. Otherwize it'll result in a "#"
I'm a little puzzled here.. should I find a rock to bang my head against or does anyone have a solution/fix for me ? :o)
Strange node object property behaviour, observed through VS debug
Hi,
I'm experiencing quite a strange behaviour interactiong with node, it's parent node and that (parent) node's NiceUrl.
I'm querying Umbraco for the current node's parent node, wich works just fine.
Then I want to get that parent node's NiceUrl, to navigate down to it (this is a sport of a back button functionality).
The resulting parent node is not the root of the website (wich is as expected).
I'm trying to go from /parent/somenode to /parent.
However.. when I ask for the parent node's NiceUrl (C#: parent.NiceUrl) it results in "#", and umbraco gives me the friendly (ugly) 404 message when I do a Responce.Redirect(parent.NiceUrl).
The strange thing is, when I step through the execution (using Debug-Attache to process) I see when .NET thinks that the NiceUrl of the parent node is "#".
BUT, if I expand the parent object, and explore the NiceUrl property (during debugging) it results in the correct path!
See picture, same property from two different views:
So, if I debug the code, and view the property (while hovering with the mouse in the code view), the code will work. Otherwize it'll result in a "#"
I'm a little puzzled here.. should I find a rock to bang my head against or does anyone have a solution/fix for me ? :o)
p.s. I'm debugging this on a IIS running on Win7 and .net 4 (with all the latest updates, including the recent exploit)
Bump.
This is a bit of a problem for me, please advice :)
Thanks,
H
Bump bump.
Am I the only one experiencing this or am I perhaps doing something that no-one does anywhay ?
We've had this issue several times as well, our solution was to use the umbraco.library.NiceUrl() function to generate the url instead.
Andres, thanks for the work around. :)
is working on a reply...