I need to encode a button that, onclick, downloads a csv file to a client computer (this is a web application)
So, some kind of research, pulled out all the lines together, go with the number, not working.
I am trying to get this now:
protected void btnDownload_onClick(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment; filename=tmp.csv");
Response.ContentType = "text/csv";
Response.Write("one,two,three,four,five");
Response.End();
}
according to the blog that appeared on google that all i need is to get that csv download it.
it doesnβt work, and I canβt understand what is wrong with him.
1) firebug inspection: the answer is EMPTY.
2) VS Debugging, strangely stops after a line Response.End()and complaints that she cannot find the content.
Am I missing something? Many thanks. highly.
: , , . ? , ajax ?