Hi I get this error when I try to export a gridview’s data to excel.
"Internet Explorer cannot display the webpage", only if the number of rows returned by the query is greater than 5010 rows.
I can see the data in the gridview, but when I hit the export button I get the error.
It is not even hitting the page_load event and giving this error.
Below 5010 rows, it is working fine.
protected void lnkExportExcel_Click(object sender, EventArgs e)
{
string strFileName = "My Excelfile1.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + strFileName);
Response.ContentType = "application/excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw); ...
Go to the complete details ...