Hi,
Does anyone know if it is possible (and it it is, how) to return multiple download responses for one postback request in ASP.NET.
The scenario is the following:
The user pushes an Export button, after which, in the event handler function of the button an SqlDataReader fills up a TextWriter which overwrites the content of the page's HttpResult.
Ex:
Response.ContentType = "application/text";
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
Response.Write(textWriter.ToString());
Response.Flush();
Response.Close();
It works fine till this point.
Now it is required to return two versions of this result with the same button click (only 1-2 extra lines and the filename would be different between the two responses).
I was wondering if it is possible to achieve this using a single postback, because the running time of the SqlDataReader is pretty long (up to 30 sec), and I would like to avoid running it twice if it is possible.
Also the size of the returned recordset can grow up, so i don't want to store it in a session variable.
Thanks in advance.
Does anyone know if it is possible (and it it is, how) to return multiple download responses for one postback request in ASP.NET.
The scenario is the following:
The user pushes an Export button, after which, in the event handler function of the button an SqlDataReader fills up a TextWriter which overwrites the content of the page's HttpResult.
Ex:
Response.ContentType = "application/text";
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
Response.Write(textWriter.ToString());
Response.Flush();
Response.Close();
It works fine till this point.
Now it is required to return two versions of this result with the same button click (only 1-2 extra lines and the filename would be different between the two responses).
I was wondering if it is possible to achieve this using a single postback, because the running time of the SqlDataReader is pretty long (up to 30 sec), and I would like to avoid running it twice if it is possible.
Also the size of the returned recordset can grow up, so i don't want to store it in a session variable.
Thanks in advance.