Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello I Have some Issues in my code First I want to display the images from the subdirectory of a directory
this is my code

@foreach (string fold in Directory.GetDirectories(Server.MapPath("~/Content/Uploads")))
{
string folder = fold.Substring(fold.LastIndexOf("\\")+1);

string path = "~/Content/Uploads/";

string paths = Path.Combine(path, folder);

string[] fo = Directory.GetFiles(Server.MapPath(paths));

foreach (string fol in fo)
{
img src ="@Url.Content(fol)" width="20%"/>

}

}
but when I run The Application
The Output is a text
Output
c:\users\brian\documents\visual studio 2012\Projects\ImagesSample\ImagesSample\Content\Uploads\Brochure 1\Brochure 1.png
instead of a Images?
Can you help Me Out here?
Thanks In advance!
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900