large datagrid preventign a redirect?

  • Thread starter Thread starter Jennifer
  • Start date Start date
J

Jennifer

I've got a datagrid on my asp page. I have a button that allows the
user to export the contents of the grid to Excel. It works great for
1300 records. If there are more than that when the export button is
clicked the network log-in pop-up appears and once I enter my info
then it re-opens the same page as if I were just entering the website
again. I don't get it. I was trying to do some research to find an
answer and did not see anything on Google that was exactly the same.
There was one suggestion out there that said to increase the IE cache
size as the amount being retrieved may be more than it could handle.
I did, but it didn't seem to help, even whe nincreasing it to 1000 MB.
Has anyone heard of this before?

Thanks,
Jennifer
 
I could be wrong but it sounds like your page is timing out.

If your method is something like the one below, then the server is rendering
the datagrid control to some html object, which is then pushed back to the
client. The RenderControl line at the server could be causing the client to
time out.

public static void ExportToXls(DataGrid dgExport, HttpResponse
response)
{

response.Clear();
response.Buffer = true;
response.Charset = "";
response.ContentType = "application/vnd.ms-excel";

System.IO.StringWriter stringWrite = new
System.IO.StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);

ClearControls(dgExport);
dgExport.GridLines = GridLines.None;
dgExport.HeaderStyle.Font.Bold = true;
dgExport.AlternatingItemStyle.BackColor =
System.Drawing.Color.WhiteSmoke;
dgExport.HeaderStyle.ForeColor =
System.Drawing.Color.DarkBlue;
dgExport.HeaderStyle.BackColor =
System.Drawing.Color.LightGray;
dgExport.RenderControl(htmlWrite);

response.Write(stringWrite.ToString());
response.End();

}
 
Thanks for your reply. My code is very similar to yours. But...my code is
not even reached. On my main page where my grid is, I've got an Export
button. When the grid is very large and the export button is clicked, the
code that is in the on_click is not even reached.

Thanks,
Jennifer
 
Back
Top