Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm new to Umbraco and I'm trying to use media picker on my site but for some reason the value is always null or empty.
I followed the steps in here but when inspecting the html code i get the following results:
<img class="img-fluid" src="" style="background-image: url('')" alt="">
Here is my code:
Layout = "Master.cshtml";
var image = Model.Value<IPublishedContent>("mainImage");
if (image != null)
<img src="@image.Url" class="img-fluid" style="background-image: url('@image')" alt="" />
In the Backoffice i added my image in Media first and i did click save and publish.
I'm running on version 8.14.1
<img src="@image.Url()" class="img-fluid" style="background-image: url('@image.Url()')" alt="" />
If you are using the new MediaPicker 3 check out this page
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted