Code mẫu

1. Config for word page HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Charset = ""; HttpContext.Current.Response.ContentType = "application/vnd.ms-word"; HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=ContentDocument.doc"); HttpContext.Current.Response.Write(htmlBody.ToString()); HttpContext.Current.Response.End(); HttpContext.Current.Response.Flush();