How to generate unordered list dynamically in asp.net?

前端 未结 2 526
孤独总比滥情好
孤独总比滥情好 2021-01-02 08:21

I want to generate a unordered list which contains tag for showing images in my database, I take a look at bulleted list, but it is not working with image. How can i dynami

2条回答
  •  醉梦人生
    2021-01-02 08:55

    I suppose your datasource is a DataSet ds that has one DataTable and a field picpath, then you can write the iteration directly in aspx

      <% foreach (DataRow dr in ds.Tables[0].Rows) { %>
    • " alt="" title=""/>
    • <% } %>

    To do it server side see the accepted answer in below link see the accepted answer in the following link Rendering an unordered list using asp.net

提交回复
热议问题