Cant retrieve mediaItem.Value<int>("umbracoHeight") in custom property editor for grid
I've got this little piece of code, all working fine in a normal view.
@{
// The Umbraco Helper has a Media method that will retrieve a Media Item by Id in the form of IPublishedContent, in this example the Media Item has a unique id of 1234:
var mediaItem = Umbraco.Media(1199);
}
@if (mediaItem != null)
{
// To get the url for your media item, you use the Url property:
var url = mediaItem.Url;
// to read a property by alias
var imageHeight = mediaItem.Value<int>("umbracoHeight");
var imageWidth = mediaItem.Value<int>("umbracoWidth");
<img src="@mediaItem.Url" alt="@imageHeight"/>
}
This code renders everything fine as it should and the image height is displayed in the alt tage in the image.
However when trying to use the same code as the renderer for my custom property editor it will not work.
It simply does not render the tag on the site. Can not even see it in inspector
Cant retrieve mediaItem.Value<int>("umbracoHeight") in custom property editor for grid
I've got this little piece of code, all working fine in a normal view.
This code renders everything fine as it should and the image height is displayed in the alt tage in the image. However when trying to use the same code as the renderer for my custom property editor it will not work. It simply does not render the tag on the site. Can not even see it in inspector
is working on a reply...