一。前台页面:
<asp:Repeater runat="server" ID="repeater" OnItemCommand="repeater_ItemCommand">
<HeaderTemplate>
<table class="datalist">
<tr><th>序号</th><th>文件名称</th><th>操作</th></tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style="width:20%; border:1px solid #66ccff; text-align:center;"><%#Container.ItemIndex+1%></td>
<td style="width:60%; border:1px solid #66ccff; text-align:left; padding-left:6px;"><%#Eval("Name") %></td>
<td style="width:20%; border:1px solid #66ccff; text-align:center;"><asp:LinkButton ID="lnkBtnDown" CommandName="downfile" CommandArgument=''<%#Eval("Name") %>'' runat="server">下载</asp:LinkButton></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
二。后台代码
protected void repeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName=="downfile")
{
string filename = e.CommandArgument.ToString();
Response.Redirect("downloadfilepage.aspx?filename=" + HttpUtility.UrlEncode(filename, Encoding.UTF8));
}
}
protected void Page_Load(object sender, EventArgs e)
{
string filename= this.Request.QueryString["filename"];
if (filename != "" && filename != null)
{
string path = Server.MapPath("~/Uploadfile/")+filename;
FileInfo file = new FileInfo(path);
if (file.Exists)
  |