Copied to clipboard

Flag this post as spam?

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


  • Simon Dingley 1474 posts 3431 karma points c-trib
    May 24, 2017 @ 10:22
    Simon Dingley
    0

    Mixed Urls on Page with GetCropCdnUrl

    I have finally got my media being served from the CDN but confusingly with mixed results which I want to understand .

    On a page I have an MVC partial view that renders some media as follows:

    @Url.GetCropCdnUrl(slide.GetPropertyValue<IPublishedContent>("image"), imageCropMode: ImageCropMode.Crop, width: width, height: height)
    

    This renders relative urls to the media items and if you try to visit on of the paths it redirects you to the CDN url.

    Elsewhere on the same page there is content that is loaded in via an API call which gets the media urls as follows:

    urlHelper.GetCropCdnUrl(media, width, height, imageCropMode: ImageCropMode.Crop).ToString();
    

    The urls returned by this are absolute to the CDN.

    Why do they behave differently given that I belive they are ultimately calling the same extension method?

    Thanks, Simon

Please Sign in or register to post replies

Write your reply to:

Draft