PDA

View Full Version : سوال: مشکل در دانلود فایل پی دی اف



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();
}

ممنون میشم از دوستان کمکم کنند.

manit44
شنبه 26 بهمن 1392, 19:14 عصر
تو رو خدا یکی جواب بده خیلی احتیاج دارم.

manit44
یک شنبه 27 بهمن 1392, 08:27 صبح
کسی نیست جواب بده؟