Hi,
yeah you can display file names in data control
Here I'm providing some code for reading list of files in directory
<asp:DataList ID="DataList1" runat="server" onitemcommand="DataList1_ItemCommand" Width ="60%"
>
<HeaderTemplate >
<table width="100%" align="center">
<tr>
<td>List of Items</td>
</tr>
</HeaderTemplate>
<itemtemplate>
<tr>
<td>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl ="~/Default13.aspx" > <%#Container.DataItem %>
</td>
</tr>
</itemtemplate>
<footertemplate>
</footertemplate></table>
And code behind file contains following code
DirectoryInfo dinfo = new DirectoryInfo(Server.MapPath ("~/Scripts"));
FileInfo[] finfo = dinfo.GetFiles();
List<string> str = new List<string>();
foreach (var g in finfo)
{
str.Add(g.FullName);
}
DataList1.DataSource = str;
DataList1.DataBind();
</string></string>
In the above code it displays all the files existing in scripts folder
I hope you understood what I said
All the Best