Select all images using ASP.NET

前端 未结 7 796
轮回少年
轮回少年 2020-12-06 16:52

I am new to ASP.NET and C#. I am trying to retrieve all images from folder and show it on page, but it\'s only selecting one image.

My ASP.NET code:

         


        
7条回答
  •  孤街浪徒
    2020-12-06 17:48

    You can dynamically add new asp:image objects to the form1.

    Image img = new Image();
    img.ImageUrl = dr["Image_Path"].ToString();
    img.AlternateText = "Test image";
    form1.Controls.Add(img);
    

提交回复
热议问题