I have this little foreach statement in an ASPX page:
<%
foreach(string path in pathList)
{
%>
<img src="<%=Url.Content(string.Format("~/Content/Images/{0}", path))%>" />
<%
}
%>
I want that to display all images using Url.Content from the list of paths.
But my code doesn’t work.
In the generated HTML, the above code returns me <img src='/Content/Images/' /> instead of <img src='/Content/Images/page.png' /> and others.
Thanks
You forgot to close the tag
ALso, are you sure the the path really has the value of ‘page.png’ ?