Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Why does the following code only display the alt field and not the image?

XML
string[] imageNames = Directory.GetFiles(Server.MapPath("~/App_Data/UploadedFiles/"));
    foreach (string row in imageNames)

    {

    <img src="@row" alt="image" /><br/>

     }
Posted
Comments
Afzaal Ahmad Zeeshan 26-Aug-15 18:59pm    
Because image (@row) does not refer to a valid image. You can see that yourself, open the console and see a list of 404 errors there.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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