Copied to clipboard

Flag this post as spam?

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


  • Nadia 45 posts 122 karma points
    Nov 25, 2011 @ 04:46
    Nadia
    0

    Razor Media Error on Upgrade to 4.7.1

    I just upgraded to 4.7.1 from 4.7.0 and my images are no longer showing. It was working fine before the upgrade.

     

    A example of my razor script

    <img itemprop="image" src="@Model.Media("Image").umbracoFile" class="thumb" />

    the src is just a blank string  and no error seems to being generated.

    I have also tried using  @Library.MediaById( @Model.Image).GetProperty("umbracoFile") but doesn't work either. 

    I am a bit stumped on this one. Has anyone got any idea what could be different betwen the upgrades? 

     

  • Evan Jardine 108 posts 168 karma points
    Nov 25, 2011 @ 04:50
    Evan Jardine
    0

    Hi Nadia

    Try doing something like this;

    @{
    var m =@Library.MediaById(@Model.image);
    var imageurl = m.umbracoFile;
    }
     <img src="@imageurl" ....

    Cheers

    Evan

  • Nadia 45 posts 122 karma points
    Nov 27, 2011 @ 21:01
    Nadia
    0

    Thanks Evan, it still doesn't work. But when I do

    var m = @Library.MediaById(@caseStudy.featuredImage);
    
            Media image = new Media(m.id);
            string imageUrl = image.getProperty("umbracoFile").Value.ToString();

    It does work. I am assuming I must be missing something with my umbraco upgrade, but not sure what. Updated all the bin files to 4.7.1

Please Sign in or register to post replies

Write your reply to:

Draft