Posted on: 9/1/2014 4:54:05 AM | Views : 540

i am trying to download pdf file from the project folder. i have using this code but it is not working,
i was searched many websites all are suggesting this. but i dont know why it is not working
if(e.CommandName=="Download") { string FileName = e.CommandArgument.ToString(); if(FileName!=string.Empty) { Response.Clear(); if(FileName.EndsWith(".txt")) { Response.ContentType = "Application/txt"; } else if(FileName.EndsWith(".pdf")) { Response.ContentType = "Application/pdf"; } else if (FileName.EndsWith(".docx")) { Response.ContentType = "Application/docx"; } else { ...

Go to the complete details ...