try
{
this.EnableViewState = false;
Response.ContentType = "text/xml"; // chnage the content type accordingly
string Filename = System.Web.HttpContext.Current.Server.MapPath("path/");
Filename = “abc.txt“;
Response.WriteFile(Filename);
string strFilename =“abc.txt";
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment; filename=" + strFilename);
}
catch (Exception ex) { Response.Write(ex.ToString()); }
Response.End();