troubleshooting Question

Display images from directory

Avatar of msout
msout asked on
Web Development
1 Comment1 Solution408 ViewsLast Modified:
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">
<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"/>
<ItemStyle BorderColor="Brown" BorderStyle="dotted" BorderWidth="3px" HorizontalAlign="Center"
VerticalAlign="Bottom" />

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
       dtlist.DataSource = ListItems

   End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros