private void Button1_Click(object sender, System.EventArgs e)
{
//엑셀로 저장
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=Question_full.xls");
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWriter = new System.IO.StringWriter();
stringWriter.WriteLine("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ks_c_5601-1987\">");
System.Web.UI.HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
DataGrid1.RenderControl(htmlWriter);
Response.Write(stringWriter.ToString());
Response.End();
}
댓글 영역