private void RenderControlToExcel(Control control)
{
System.IO.StringWriter tw = new System.IO.StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
control.RenderControl(hw);
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "UTF-8";
Response.Write(tw.ToString());
Response.End();
}