<asp:DataList Width="100%" ID="imgDataList" runat="server" RepeatColumns="4" CellPadding="10"> <ItemTemplate> <table runat="server" id="tblImgList" border="1" width="100%"> <tr> <td align="center"> <a id="Link1" runat="server" href='<%# Eval("Value") %>' target="Default.aspx"> <asp:Image ID="imgDisp" ImageUrl='<%# Eval("Value") %>' runat="server" style="height :200px ; width :200px ;" /> </a> </td> </tr> <tr> <td align="center"> <%# Eval("Text") %> </td> </tr> </table> </ItemTemplate> </asp:DataList>
If Not IsPostBack Then Dim filePaths As String() = Directory.GetFiles(Server.MapPath("~/Images/")) Dim files As New List(Of ListItem)() For Each filePath As String In filePaths Dim fileName As String = Path.GetFileName(filePath) files.Add(New ListItem(fileName, "~/Images/" + fileName)) 'Automatically add pictures in listdata. Displayed using databind Next imgDataList.DataSource = files imgDataList.DataBind() End If
<%# Eval("Text") %>
Sessions
login
username
password
DataList
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)