Posts

Showing posts from June, 2016

Export Html string to word in asp.net

This is a simple blog to demonstrate how to export hmtl string to MS Word. So here i going to create a function with parameter filename and htmlstring. public void downloadAsWord(String filename, String htmlstring)     {         HttpContext.Current.Response.Clear();         HttpContext.Current.Response.ContentType = "application/msword";         HttpContext.Current.Response.ContentEncoding = System.Text.UnicodeEncoding.UTF8;         HttpContext.Current.Response.Charset = "UTF-8";         Response.AddHeader("Content-Disposition", "attachment; filename=" + filename + ".doc");         Response.Write("<html>");         Response.Write("<head>");         Response.Write("<META HTTP-EQUIV=Content-Type CONTENT=text/html charset=UTF-8>");         Response.Write("...