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 tried to get the page background image using media picker. I use the below code. but it does not work. Is there any other code to it?
Does your code for retrieving "backImage" return anything? I can't quite tell from the image whether you're in a partial or in a template with the model where this image is located.
Once you've got the field, depending on your version of Umbraco and whether Property Value Converters are enabled you may need to convert the Media id to a media object and then get it's URL.
var backgroundUrl = String.Empty;
var backgroundImage = Umbraco.TypedMedia(Model.Content.GetPropertyValue<int>("backImage"));
if (backgroundImage != null)
backgroundUrl = backgroundImage.Url;
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted