Geeks With Blogs
Sharvan Dhaka blog
string Id= "0";
try
{
this.EnableViewState = false;
Response.ContentType = "text/.txt";
string Filename = System.Web.HttpContext.Current.Server.MapPath("txt/");
Filename = Filename + Id + ".txt";
Response.WriteFile(Filename);
// Response.Write("string");
string strFilename = Id + ".txt";
Response.Buffer = true;
Response.AddHeader("Content-Disposition", "attachment; filename=" + ID+".txt");
}
catch (Exception ex) { Response.Write(ex.ToString()); }
Response.End();
Posted on Sunday, October 15, 2006 5:56 PM Asp.net , Tricky Solution/ Code | Back to top


Comments on this post: Force a page to download a file c# asp.net

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Sharvan Dhaka | Powered by: GeeksWithBlogs.net