Hello,
I am trying to open a txt file from a link in a gridview.
this is code i have,
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
EmptyDataText="No records found matching your criteria" Font-Bold="true">
<Columns>
<asp:BoundField DataField="file_name" HeaderText="File Name"/>
<asp:TemplateField HeaderText="Open">
<ItemTemplate>
<asp:HyperLink ID="Open" NavigateUrl='<%# Eval("file_name") %>' Text='<%# Eval("file_name") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
The problem - when I take the mouse on the "Open" link it says- http://localhost//4444\abc.txt and the value of the file_name field is abc.txt (not C:\folder1\abc.txt) and it is not opening the file.
the location of file is C:\folder1\abc.txt
What I am doing wrong? Should I write any code from codebehind too? How do I open this file? Is there any another way? Please it is kind of urgent.
Thanks in advance.