Copied to clipboard

Flag this post as spam?

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


  • Ivan 165 posts 543 karma points
    Aug 24, 2013 @ 22:19
    Ivan
    0

    Use querystring-url as image param

    Hi guys.

    Is that possible do something like that:

    var imgUrl = "http://image-generator.aspx?guid=1234"; // that url generates image

    <img src="/ImageGen.ashx?image=@imgUrl" />

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 27, 2013 @ 12:01
    Douglas Robar
    100

    Hi, Ivan,

    No problem with your razor, it'll work just fine in a macro.

    @{
            var imgUrl = "http://image-generator.aspx?guid=1234"; // that url generates image
            <img src="/ImageGen.ashx?image=@imgUrl" />
    }
    

    You'll need to use ImageGen Professional to make the remote request, though. And add the remote domain to the /config/imagegen.config file so that it is allowed (by default ImageGen doesn't allow remote requests to protect your server from being abused as a resizing engine for everyone on the internet).

    See the docs for further info about using remote domains.

    cheers,
    doug.

  • Ivan 165 posts 543 karma points
    Aug 27, 2013 @ 14:24
    Ivan
    0

    Hi Doug.

    Thank you for the answer!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies