<asp:DataList ID="dList1" runat="server" RepeatColumns="4">
    <ItemTemplate>
 
    <asp:Image runat="server" ID="img1" ImageUrl='<%# Eval("Name","~/Images/{0}") %>' Width="50px" Height="40px" name="imgA" />

   
    <img src="images/aa.jpg" width="50px" height="40px" onclick="show()" name="imgB"/>
  
    </ItemTemplate>
    </asp:DataList>

后台

  string path =MapPath("~/Images/");
       DirectoryInfo dir = new DirectoryInfo(path);

       dList1.DataSource = dir.GetFiles();
       dList1.DataBind();

相关文章:

  • 2021-11-14
  • 2021-10-24
  • 2021-11-11
  • 2021-07-11
  • 2022-12-23
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2022-01-05
  • 2021-09-10
  • 2022-12-23
  • 2021-11-23
  • 2022-02-25
相关资源
相似解决方案