Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Greg 14 posts 34 karma points
    Dec 07, 2010 @ 15:03
    Greg
    0

    Node.NiceUrl == "#" except for debugging

    I have the following code

    Node node = new Node(1234);
    string url = node.NiceUrl.ToLowerInvariant();
    Response.Redirect(url, true);

    When I run this code normally (in Cassini) more often than not (like 95%) of the time get redirected to "/#", as if

    node.NiceUrl == url == "#"

    If I debug the code and step through it in VisualStudio, 95% of the time then the code works as expected, e.g.

    node.NiceUrl == "/some-correct-url"

    but sometimes I actually see NiceUrl == "#".

    Why is this?

    I'm using the binary ditribution of Umbraco 4.5.2 on 64Bit Windows 7 Pro, Visual Studio 2010 and SQL 2008

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Dec 07, 2010 @ 15:23
    Jeroen Breuer
    2

    I'm not sure why this happens. Also had it myself a couple of times. You can use umbraco.library.NiceUrl(id) as an alternative. If that doesn't work the content might not be published correctly. Try to republish the entire site and see what happens.

    Jeroen

  • Lennart Stoop 304 posts 842 karma points
    Dec 09, 2010 @ 09:50
    Lennart Stoop
    0

    Yes, I have also come across this issue, even during debugging.

    The one property that consequently does have a value is Url (rather than NiceUrl).

  • tentonipete 78 posts 223 karma points
    Apr 09, 2012 @ 23:04
    tentonipete
    0

    i have this error too. extremely bizarre. umbraco.library.NiceUrl(id) does work though. 

Please Sign in or register to post replies

Write your reply to:

Draft