Changing Response.Header makes javascript unresponsive on my page
I use
response.AddHeader("content-disposition", "attachment;filename=file.xls");
response.ContentType = "application/vnd.ms-excel";
as a method to generate a CSV/Excel file in my page. It works like a charm, however, after I open the file, the scripts on my page are unresponsive; trying tie J开发者_如何学运维S onclick on any component on my page dosen't work.
Any Ideas/suggestions???
The root cause is the Content Type.
Javascript only works with certain combinations of ContentType ... of which 'js' itself must be a part. Try reverting ContentType dynamically to JS compatible type.
精彩评论