<asp:Button ID="btnPDF" runat="server" Text="PDF" ToolTip="Download the PDF" onclick="btnPDF_Click" />
<asp:Button ID="btnEXECL" runat="server" Text="EXCEL" ToolTip="Download the EXCEL" onclick="btnEXECL_Click" />
Script Code:
$("input[type='submit']").click(function (e) { var type = $(this).val(); var url = "DownloadFile.aspx?type=" + type; $.post(url);});These code are placed inside the default.aspx page. From here i've called the "DownloadFile.aspx" using post method. the method is called and the files have been created but not download at the end.
$("input[type='submit']").click(function (e) {
var type = $(this).val();
var url = "DownloadFile.aspx?type=" + type; $.post(url);
var url = "DownloadFile.aspx?type=" + type;
$.post(url);
});