【发布时间】:2017-08-10 10:11:13
【问题描述】:
我有一个gridview,我用路径中的文件名填充它,知道,我希望文件名是可点击的,所以我可以下载它们,但我不知道如何,有人可以帮助我。 代码隐藏(文件是gridview ID)
string path = "//the path";
string[] Fname = Directory.GetFiles(path).Select(Path.GetFileName).ToArray();
file.DataSource = Fname;
file.DataBind();
网页
<asp:GridView ID="file" runat="server" style="border:hidden" ></asp:GridView>
【问题讨论】:
-
请看这个问题:stackoverflow.com/questions/19798685/…。我相信这是类似的问题。