Use a linkbutton so you can run serverside code on click:
<asp:LinkButton ID="hl_download" runat="server" OnClick="hl_download_Click">Download</asp:LinkButton>
Then, in the codebehind:
public void hl_download_Click(Object sender, EventArgs e)
{
Response.AddHeader("Content-Type", "application/octet-stream");
Response.AddHeader("Content-Transfer-Encoding","Binary");
Response.AddHeader("Content-disposition", "attachment; filename=\"IdeaPark_ER_diagram.pdf\"");
Response.WriteFile(HttpRuntime.AppDomainAppPath + @"ideaPark\DesktopModules\ResourceModule\pdf_resources\IdeaPark_ER_diagram.pdf");
Response.End();
}
This assumes that the web path maps cleanly to the filesystem path of the file. Otherwise modify Response.WriteFile()
so that it points to the location of the pdf file on the filesystem.