Displaying Images from Multiple Media Picker

Hi,

I'm not sure what I'm missing here, but I have a simple page where I have a multiple media picker and I'm just trying to display the images. The.Path property just returns -1,1062

@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
	var ms = ApplicationContext.Current.Services.MediaService;
}

<section id=“@CurrentPage.Name” class=“one”>
<div class=“container”>
<header>
<h2>
@Html.Raw(Umbraco.ReplaceLineBreaksForHtml(CurrentPage.PictureHeader))
</h2>
</header>
@{

		char[] splitChar = { ',' };
		string[] ids = CurrentPage.Pictures.ToString().Split(splitChar, StringSplitOptions.RemoveEmptyEntries);

		foreach (string id in ids )
		{
			int imageId = int.Parse(id);
			@ms.GetById(imageId).Path;
		}
	}
&lt;/div&gt;

</section>

 

I can't seem to get the image path returned. I tried getting the .umbracoFile property, but that's not available. I see it in the xml though if I write out the @ms.GetById(imageId).ToXml();

<Image id="1062" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2013-12-18T12:08:04" updateDate="2013-12-18T12:08:04" nodeName="Pic.png" urlName="picpng" path="-1,1062" isDoc="" nodeType="1032" writerName="admin" writerID="0" version="a53dbbee-5fc5-4455-ad0c-5af6134512ca" template="0" nodeTypeAlias="Image">  <umbracoFile><![CDATA[/media/1002/Pic.png]]></umbracoFile>  <umbracoWidth><![CDATA[301]]></umbracoWidth>  <umbracoHeight><![CDATA[232]]></umbracoHeight>  <umbracoBytes><![CDATA[126549]]></umbracoBytes>  <umbracoExtension><![CDATA[png]]></umbracoExtension>< /Image>

 

I'm surprised this is not easier to do and I have to jump thru all these hoops to get there.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/46969-displaying-images-from-multiple-media-picker