Quantcast
Channel: ActiveTopics
Viewing all articles
Browse latest Browse all 72689

Get Multiple Images from Media Picker from another Model

$
0
0

I have a Master template which has the header and footer for each page.

Each page thereafter is rendered inside that Master template using @RenderBody().

In the Hompage Model I have a media picker using multiple images.

I can call the media picker on the homepage but not on any other page

Works on hompega eusing the following

 @{   var typedMultiMediaPicker = Model.Content.GetPropertyValue<IEnumerable<IPublishedContent>>("asscoiates_logos_slider");

  foreach (var item in typedMultiMediaPicker)
   {
    var URL = item.GetPropertyValue<string>("imageURL");
    <div>
    <a href="@URL" target="_blank"><img src="@item.Url" alt="" /></a>
   </div>
     }
     }

When displaying from a page that is not the homepage i get error

System.NullReferenceException: Object reference not set to an instance of an object.

Im thinking its because the properties are set on the homepage therefore works on home page.

Otherwise : How do I do recursive with multiple images with media picker.


Viewing all articles
Browse latest Browse all 72689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>