User-2106054853 posted
Hi,
It's just as what you do for GridView:
Response.Clear();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Response.AddHeader("content-disposition", "attachment; filename=FileName1.xls");<o:p></o:p> Response.Charset = "";<o:p></o:p>
Response.ContentType = "application/vnd.xls";<o:p></o:p> System.IO.StringWriter stringWrite = new System.IO.StringWriter();<o:p></o:p>
System.Web.UI.HtmlTextWriter htmlWrite =
new HtmlTextWriter(stringWrite);
Label1.RenderControl(htmlWrite);
Panel1.RenderControl(htmlWrite);
GridView1.RenderControl(htmlWrite);<o:p></o:p>
Response.Write(stringWrite.ToString());<o:p></o:p> Response.End();<o:p></o:p>