Copied to clipboard

Flag this post as spam?

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


  • Gavin 2 posts 27 karma points
    Mar 29, 2010 @ 19:25
    Gavin
    0

    NiceUrlFullPath is not returning the domain name of path

    I am wriitng a user control that I would like to return the full url of a page. However when I call NiceUrlFullPath it only returns a path without the domain.

     

    postedmessage.Body = messageBody + messageFromFriendTxt.Text + umbraco.library.NiceUrlFullPath(pageID);

     

    Any ideas?

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Mar 29, 2010 @ 19:47
    Richard Soeteman
    0

    Hi,

    You have to format it yourself. Try

    string

     

    .Format("http://{0}{1}", HttpContext.Current.Request.ServerVariables["HTTP_HOST"], umbraco.library.NiceUrl(pageID));

    Cheers,

    Richard

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 29, 2010 @ 20:46
    Dirk De Grave
    1

    Gavin

    Richard is correct, but there's a way to have it included. If your settings

    <useDomainPrefixes>false</useDomainPrefixes>

    in umbracoSettings.config is set to "true", then the domain name will be included when calling NiceUrl()

    (it's mostly applicable when using multiple sites in a single umbraco installation where the sites have different host names assigned)

    Cheers,

    /Dirk

  • Gavin 2 posts 27 karma points
    Mar 30, 2010 @ 11:30
    Gavin
    0

    Thanks guys...both solutions work....thanks

Please Sign in or register to post replies

Write your reply to:

Draft