Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to return two results with one postback

Reply
Thread Tools

How to return two results with one postback

 
 
egyedg egyedg is offline
Junior Member
Join Date: Mar 2009
Posts: 1
 
      03-11-2009
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Getting all google results with hpricot and connecting two gsubstatements to just one? kazaam Ruby 3 08-29-2007 10:26 PM
Prefix increment/decrement results in lvalue, but postfix one results in rvalue? lovecreatesbeauty C++ 8 09-12-2005 10:23 PM
what value does lack of return or empty "return;" return Greenhorn C Programming 15 03-06-2005 08:19 PM
CSS aligning two things on one line with one left and one right news.frontiernet.net HTML 6 04-16-2004 02:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57