Q:

Using string format for Url.Content doesn't work

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

A:

You forgot to close the tag
 <img src="<%=Url.Content(string.Format("~/Content/Images/{0}", path)) %>" />

ALso, are you sure the the path really has the value of 'page.png' ?

