Table.RenderControl error!!!

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top