I need to download a PDF that I have stored inside a folder in my application, I want it to open in a new tab.
The following code works perfectly for me in my local application but once published on the server and trying to download the file, it throws the error:
'404 error file or page not found'
Code that works in my local application but not on the server:
protected void Manual_Click(object sender, EventArgs e)
{
System.Web.UI.ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('/ModuloGeneral/ImpresionConf/Manual.pdf'),'_blank')", true);
}
I also tried adding the ñuflo in front of the url but it does not work either:
System.Web.UI.ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('~/ModuloGeneral/ImpresionConf/Manual.pdf'),'_blank')", true);
and this way it does not work either:
System.Web.UI.ScriptManager.RegisterStartupScript(Page, Page.GetType(), "popup", "window.open('~\ModuloGeneral\ImpresionConf\Manual.pdf'),'_blank')", true);
I leave the .aspx of the LinkButton that I use to download the file:
<td colspan="7" align="center">
<asp:LinkButton ID="Manual" runat="server" class="lnkDocumento" OnClick="Manual_Click">Manual</asp:LinkButton><br /><br />
</td>