Display Image from IEnumerable <IPublishedContent> in a partial view
In controller I return an Inumerable to a partial view
public ActionResult News (RenderModel model, string Name)
{
Where (x => x.Name == Name) .Where (x => x. IsVisible ()) FirstOrDefault ();
IEnumerable <IPublishedContent> Children = News.Children () Where (x => x.IsVisible ()) OrderBy ("UpdateDate"). Take (5);
return PartialView ("~ / Views / Partials / SmallNewsHome.cshtml", Children);
}
In the partial view I called the model: @model IEnumerable <IPublishedContent> and without @inherits Umbraco.Web.Mvc.UmbracoTemplatePage but so I can not use Umbra.TypedMedia (firstchild.GetPropertyValue <string> ("hinhAnh")) So what should I do in this case?
Display Image from IEnumerable <IPublishedContent> in a partial view
In controller I return an Inumerable to a partial view
In the partial view I called the model:
@model IEnumerable <IPublishedContent>
and without@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
but so I can not useUmbra.TypedMedia (firstchild.GetPropertyValue <string> ("hinhAnh"))
So what should I do in this case?Hi,
Can you post the full code of the controller ? I can't see what kind of controller you are using (eg. surface, rendermvc,..)
I also think something went wrong with the formatting.
Can you also post the code of your views ? The one calling the controller action and the one used to render the action.
Dave
is working on a reply...