Geeks With Blogs
Gaurav Taneja Great dreams... never even get out of the box. It takes an uncommon amount of guts to put your dreams on the line, to hold them up and say, "How good or how bad am I?" That's where courage comes in.

         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(); 

Posted on Saturday, September 30, 2006 4:56 AM .Net | Back to top

Copyright © Gaurav Taneja | Powered by: GeeksWithBlogs.net