protected void GenerateDoc(object sender, EventArgs e) { string strBody = "<html>" + "<body>" + " <b>Hello team,<br><br> <table>" + "<tr><td colspan=\"2\">Document Detail :-<br><br></td>" + "<tr><td>Document Code :</td> <td>" + TextBox1.Text + "</td></tr>" + "<tr><td>Document Name :</td> <td>" + TextBox1.Text + "</td></tr>" + "<tr><td>Employee Code :</td> <td>" + TextBox1.Text + "</td></tr>" + " </table><br>This Document is to inform you all that a new document with the above details has been uploaded to the server</b>" + "<font color=\"blue\"><br><br>Thanks & Regards<br>" + TextBox1.Text + "</font>"+ // this is another table "<div>Your name is: <b>" + TextBox1.Text + "</b></div>" + "<BR><BR><table border=5><tr><td>1st Cell data</td><td>2nd cell data</td></tr></table>" + "</body>" + "</html>"; string fileName = "Demo.doc"; Response.AppendHeader("Content-Type", "application/msword"); Response.AppendHeader("Content-disposition", "attachment; filename=" + fileName); Response.Write(strBody); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)