In the below code i want to download a file from local when i click link button it should download a file from specific path. In my case it throws
'C:/Search/SVGS/Documents/img.txt' is a physical path, but a virtual path was expected.
protected void lnkbtndoc_Click(object sender, EventArgs e){ LinkButton lnkbtndoc = new LinkButton(); var SearchDoc = Session["Filepath"]; string file = SearchDoc.ToString(); Response.AddHeader("Content-Disposition", "attachment;filename=\""+ file +"\""); Response.TransmitFile(Server.MapPath(file)); Response.End();}