Hi,
I wanna export the data into PDF/EXCEL. for PDF i'm using iTextSharp.dll, for EXCEL using HtmlTable. I wanna export the data using Ajax post.
Scenario:
I've a seperate button for Export data into Excel and PDF, when i click the button i wanna download the files appropriately without page load, so i've used the Ajax post method. the method was successfully called. but the files are not downloaded. can anyone assist me to get the solution.
My .aspx code:
VB.NET
asp:Button ID="btnPDF" runat="server" Text="PDF" ToolTip="Download the PDF" onclick="btnPDF_Click" />VB.NET
asp:Button ID="btnEXECL" runat="server" Text="EXCEL" ToolTip="Download the EXCEL" onclick="btnEXECL_Click" />Code
Code
Script Code:Code
$("input[type='submit']").click(function (e) {Code
var type = $(this).val();Code
var url = "DownloadFile.aspx?type=" + type;Code
$.post(url);Code
});

Vithal WadjeRank #19 · 47.2K reputationPosted Mar 23, 2015, 9:30 AM EDT
http://www.c-sharpcorner.com/UploadFile/0c1bb2/export-gridview-to-pdf/
Sathish Kumar65 reputationPosted Mar 23, 2015, 11:06 PM EDT
Joginder BangerRank #360 · 7K reputationPosted Mar 23, 2015, 11:42 PM EDT
Pdf
Excel
PathOfPage coding parts
page_loadEvent(object sender,Eventags e)
{
//get the type through the query string value....
downloadfunction(type);
}
public void downloadfunction(string type)
{
}
Sathish Kumar65 reputationPosted Mar 24, 2015, 3:19 AM EDT
Joginder BangerRank #360 · 7K reputationPosted Mar 24, 2015, 9:04 AM EDT
It's really help me for download every type of format file.