01.
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
02.
response.ClearContent();
03.
response.Clear();
04.
response.ContentType =
"text/plain"
;
05.
response.AddHeader(
"Content-Disposition"
,
06.
"attachment; filename="
+ fileName +
";"
);
07.
response.TransmitFile(Server.MapPath(
"text.txt"
));
08.
response.Flush();
09.
response.End();