Copied to clipboard

Flag this post as spam?

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


  • Aximili 177 posts 278 karma points
    May 25, 2011 @ 08:03
    Aximili
    0

    ResolveUrl

    Is there a shorter way of writing this in .cshtml?

    @umbraco.IO.IOHelper.ResolveUrl("~/myPath")

    I wonder why @Url.Content doesn't work?

  • Sebastiaan Janssen 5045 posts 15477 karma points MVP admin hq
    May 25, 2011 @ 08:12
    Sebastiaan Janssen
    0

    @Url.Content doesn't work because that's an MVC thing, Umbraco isn't quite there yet.

    You can use:

     VirtualPathUtility.ToAbsolute("~/myPath");

    I'm sure that that is what ResolveUrl is doing internally anyway.

  • Aximili 177 posts 278 karma points
    May 25, 2011 @ 08:59
    Aximili
    0

    cool, that's a little bit shorter, thanks!

  • Richard Boelen 61 posts 153 karma points
    Jun 29, 2012 @ 23:10
    Richard Boelen
    0

    @Href("~/myPath") should work now also

Please Sign in or register to post replies

Write your reply to:

Draft