Hi baswal07,
Use GetFileName of Path class to set the name of the file in Label control.
Refer below modified code.
<asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal">
<ItemTemplate>
<asp:Image ID="Image2" runat="server" ImageUrl='<%# Container.DataItem %>' Width="350px" Height="250px" /><br />
<asp:Label ID="label1" runat="server" Text='<%#System.IO.Path.GetFileName(Container.DataItem.ToString()) %>' />
</ItemTemplate>
</asp:DataList>
Code
string[] filesindirectory = Directory.GetFiles(Server.MapPath(filePath));
List<String> images = new List<string>(filesindirectory.Count());
foreach (string item in filesindirectory)
{
if (IsImageFile(item))
{
images.Add(string.Format("~/../singimages/{0}", System.IO.Path.GetFileName(item)));
}
DataList1.DataSource = images;
DataList1.DataBind();
}