Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Excel File downloading page contents

$
0
0

Hi,

I have excel file on my server and I want to send it client side. 

I have the follwing code

Response.Buffer = true;
Response.ClearContent();
Response.ContentType = "application/ms-excel";
Response.AddHeader("Content-Disposition", @"attachment;filename=" + fileName);
Response.Charset = "";
Response.TransmitFile(Server.MapPath(fileName));
HttpContext.Current.ApplicationInstance.CompleteRequest();
System.Runtime.InteropServices.Marshal.ReleaseComObject(excel);
System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook);

On client side I m receiving the file but it has Page contents and not the contents which i have saved in it.

Please help.

Thanks

Ashok


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>