public class RegisterSubscription { public string ID { get; set; } public string Description { get; set; } public int SubscrSelected { get; set; } public string Image { get; set; } public string InfoUrl { get; set; } } private List<RegisterSubscription> activePlans = new List<RegisterSubscription>();
In my controller, I have ViewBag.ActivePlans = activePlans; , and the ViewBag fills in the correct data. Now, in my opinion, I:
@foreach (var item in ViewBag.ActivePlans) { <li class="popupmenu" id=" service_@ (item.ID)" > <div> @Html.Image(item.Image, new { style="border-style:none; text-align:left; vertical-align:middle; width:64px; height:64px" }) </div> </li> }
but I get the following error: "System.Web.Mvc.HtmlHelper" does not have an applicable method named "Image", but this name has an extension method. Extension methods cannot be dynamically dispatched. Think about how to use dynamic arguments or invoke an extension method without extension method syntax.
Any help would be greatly appreciated, thanks in advance.
source share