Add a new page say DownloadFile.aspx and add the following code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
string fileName = Request.QueryString["pdffile"];
string path = Server.MapPath("~/PDFs/") + fileName;
Response.ContentType = "application/pdf";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.WriteFile(path);
Response.Flush();
Response.End();
}
}
Now in GridView remove LinkButton and add HyperLink as shown below
<asp:HyperLink ID="HyperLink1" runat="server" Target = "_Blank" NavigateUrl='<%# Eval("FileName","DownloadFile.aspx?PDFFile={0}") %>'></asp:HyperLink>