<%@ Page Language="C#" Debug="true" %> <script runat="server"> void Page_Load(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("Content-Disposition", "Attachment;Filename=Excel.xls"); Response.Buffer = true; Response.Charset = "UTF-8"; Response.ContentType = "application/vnd.ms-excel"; Response.Write("<table width=500 border=1>"); Response.Write(" <tr>"); Response.Write(" <td>Column1</td>"); Response.Write(" <td>Column2</td>"); Response.Write(" <td>Column3</td>"); Response.Write(" </tr>"); Response.Write(" <tr>"); Response.Write(" <td>1</td>"); Response.Write(" <td>2</td>"); Response.Write(" <td>3</td>"); Response.Write(" </tr>"); Response.Write(" <tr>"); Response.Write(" <td>4</td>"); Response.Write(" <td>5</td>"); Response.Write(" <td>6</td>"); Response.Write(" </tr>"); Response.Write("</table>"); } </script>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท