manit44
شنبه 26 بهمن 1392, 14:03 عصر
سلام
من یه گرید ویو دارم که یک ستون آن به صورت لینک باتن است و میخوام که روی هر لینک که کلیک کردم فایل مخصوص به خودش دانلود بشه ولی نمیشه اینم کدمه:
string Sql = "select service_code from CLRGOV.CLR_ORGANAZATION_SERVICE";
string File = Server.MapPath("~/files/"+Sql+".pdf");
System.IO.FileInfo toDownload = new System.IO.FileInfo(File);
if (toDownload.Exists)
{
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + toDownload.Name);
Response.AppendHeader("Content-Length", toDownload.Length.ToString());
Response.TransmitFile(File);
GridView1.DataBind();
}
ممنون میشم از دوستان کمکم کنند.
من یه گرید ویو دارم که یک ستون آن به صورت لینک باتن است و میخوام که روی هر لینک که کلیک کردم فایل مخصوص به خودش دانلود بشه ولی نمیشه اینم کدمه:
string Sql = "select service_code from CLRGOV.CLR_ORGANAZATION_SERVICE";
string File = Server.MapPath("~/files/"+Sql+".pdf");
System.IO.FileInfo toDownload = new System.IO.FileInfo(File);
if (toDownload.Exists)
{
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + toDownload.Name);
Response.AppendHeader("Content-Length", toDownload.Length.ToString());
Response.TransmitFile(File);
GridView1.DataBind();
}
ممنون میشم از دوستان کمکم کنند.