Table.RenderControl error!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the next code:

private void Button1_Click(object sender, System.EventArgs e)
{
// Exportar a excell
Response.Clear();
Response.Buffer=true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);

Table1.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());

Response.End();
}

When I save the output file and then open it, no data in the excel file
exists, but with other table (Table2), the file is valid.

The first table is filled with code, and the second one is static. Is there
some condition to this error occur? some attribute?
 
Back
Top