0

下载保存在上述目录中的文件时出现此错误Could not find a part of the path 'c:\users\mehdi\documents\visual studio 2012\Projects\Grid\Grid\Data Files\'.。下载代码为:

        protected void LinkButton1_Click(object sender, EventArgs e)
    {
        LinkButton lnkbtn = sender as LinkButton;
        GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
        string filePath = GridView1.DataKeys[gvrow.RowIndex].Value.ToString();
        Response.TransmitFile(Server.MapPath("~/Data Files/"));
        Response.End();
    }

请帮忙..

4

1 回答 1

0

尝试将 Server.MapPath("~/Data Files/") 更改为 Server.MapPath("~\Data Files\")

于 2013-09-25T18:55:46.573 回答