i googled and got a little code.
<asp:DataGrid runat="server" id="articleList" Font-Names="Areal"
AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#eeeeee"
HeaderStyle-BackColor="Navy" HeaderStyle-ForeColor="White"
HeaderStyle-Font-Size="12pt" HeaderStyle-Font-Bold="True">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="Name" DataTextField="Name"
HeaderText="File Name" />
<asp:BoundColumn DataField="LastWriteTime" HeaderText="Last Write Time"
ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
<asp:BoundColumn DataField="Length" HeaderText="File Size"
ItemStyle-HorizontalAlign="Right"
DataFormatString="{0:#,### bytes}" />
</Columns>
</asp:DataGrid>
vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dirInfo As New DirectoryInfo(Server.MapPath("policy"))
articleList.DataSource = dirInfo.GetFiles("*.pdf")
articleList.DataBind()
End Sub
the code above lists the files with hyperlink in a afolder but when i click on the link it gives error
The resource cannot be found.
but i ensured that the file is there in folder named policy in my web folder
when i chage the folder name "POLICY" to " ""(Blank) then it displays the pdf files from my web and the links also works correctly when i change the "" to "policy" then the hyperlink is not working