Avatar of msout
msout asked on

Display images from directory

I need to display images from the directory. I use datalist and it shows images but it also shows link -Thumbs.db on the page. When I click the link -there is nothing. I do not have this db in my directory. How can I get rid of this Thumbs.db link on the page?
Please, advise

My apsx form:
 <asp:DataList ID="dtlist" runat="server" RepeatColumns="3" CellPadding="5">
<ItemTemplate>
<asp:Image Width="100" ID="Image1" ImageUrl='<%# Bind("Name", "~/Images1/{0}") %>' runat="server" />
<br />
<asp:HyperLink ID="HyperLink1" Text='<%# Bind("Name") %>' NavigateUrl='<%# Bind("Name", "~/Images1/{0}") %>' runat="server"/>
</ItemTemplate>
<ItemStyle BorderColor="Brown" BorderStyle="dotted" BorderWidth="3px" HorizontalAlign="Center"
VerticalAlign="Bottom" />
</asp:DataList>

My code:

Public Sub BindDataList()


        Dim dir As New DirectoryInfo(MapPath("Images1"))
        Dim files As Array = dir.GetFiles()
        Dim ListItems As New ArrayList
        For Each FileInfo In files
           ListItems.Add(FileInfo)
        Next
       dtlist.DataSource = ListItems
        dtlist.DataBind()

   End Sub
Web Development

Avatar of undefined
Last Comment
Robert Schutt

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Robert Schutt

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck