Am a newbie in umbraco and razor. Am having an issue with in displaying images for slideshow . It gives me the following error Cannot get MediaById without an id . Please find my code below and many thanks for your kind responses.
P.S am using umbraco v 4.7.0 (Assembly version: 1.0.4868.25116)
var title =@events.Name; var mediaIdFolder = @events.GetProperty("eventPhotoGallery").Value.ToString(); var mediaFolder = @Library.MediaById(2647); var imgpath = @mediaFolder.Children.First().HasValue("umbracoFile") ? @mediaFolder.Children.First().umbracoFile : "/media/60612/dummy.jpg"; var img="{image:"; var eventName =",title:"; var eventDate =",dateEvent:"; var closingslide="},"; var description= @events.GetProperty("eventDescription").Value.ToString(); var startEventDate= @library.FormatDateTime(@events.GetProperty("startEventDate").Value.ToString(),"dd/MM/yyyy"); var endEventDate = @library.FormatDateTime(@events.GetProperty("endEventDate").Value.ToString(),"dd/MM/yyyy"); var slides = @img +"\'"+@imgpath+"\'"+@eventName+"\'"+@title +"\'"+@eventDate+"\'"+@startEventDate+"\'"+@closingslide; @Html.Raw(@slides) } @Html.Raw("]") }
Cannot get MediaById without an id
Dear all,
Am a newbie in umbraco and razor. Am having an issue with in displaying images for slideshow . It gives me the following error Cannot get MediaById without an id . Please find my code below and many thanks for your kind responses.
P.S am using umbraco v 4.7.0 (Assembly version: 1.0.4868.25116)
is working on a reply...