public void HTMLToOthers(string filename, string filetype) { if (filename.Trim() != "") { Response.ContentType = "application/vnd" + filetype; Response.AddHeader("content-disposition", "attachment;filename=" + filename); System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite); System.Web.UI.Page sPage = new System.Web.UI.Page(); sPage.RenderControl(htmlWrite); Response.Write(stringWrite.ToString()); }
}
|
Suthish NairPosted Aug 20, 2010, 12:24 PM
Response.ContentType = "application/vnd" + filetype; Response.ContentType = "application/vnd." + filetype;