473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to send info to client but continue server processing ??

Hi,

how can I send information that is in the Response.OutputStream to the
client but continue server processing without having to close the page , or
without having to Reponse.End() the application ?
I tried Response.OutputStream.Flush(); but it doesn't seem to work, only
when I follow it with a Reponse.End() , but that's then gonna stop the
server processing what is what I don't want.

Here's my problem : in a button-event handler

void btnSubmitSendback_Click(object sender, System.EventArgs e)
{
byte[] sendData = Encoding.ASCII.GetBytes(strXmlContent);
// strXmlContent contains some info I want the client to save

// Popup a dialog-box at the client
Response.AddHeader("content-disposition","attachment;");
Response.OutputStream.Write(sendData, 0, sendData.Length);

lblStatus.Text = "OK";
}
The result is that the client gets a "File Save as..." dlgBox allowing him
to save the contents. OK.
Problem is that not only 'strXmlContent' was saved but the contents of the
HTML-page as well !!

Now, I try to separate the two by :
// first sending the content then clearing the header
Response.AddHeader("content-disposition","attachment;");
Response.OutputStream.Write(sendData, 0, sendData.Length);
Response.OutputStream.Flush();
Response.ClearHeaders();
lblStatus.Text = "OK";

but it doesn't work. I tried lots of other things, as well using
Response.ClearContent() but nothing works.
Using Response.End() after the Response.OutputStream.Write(...) will show
the popup but will not return my new page. (so the client doesn't see "OK")

Anyway, either the new page is shown to the client but then no popup
appears, or the client gets a popup but the info saved contains the
html-code of the page as well.

So, actually do I want to send some info to the client enabling him to save
the
info (and nothing else) via a popup, and as well do I want to show the
client the
refreshed page.

Any help GREATLY appreciated

Chris

Nov 18 '05 #1
1 2210
I tink that is sufficient "Response.Flush();"

"Chris" <ch********@pandora.be> ha scritto nel messaggio
news:ZP***********************@phobos.telenet-ops.be...
Hi,

how can I send information that is in the Response.OutputStream to the
client but continue server processing without having to close the page ,
or
without having to Reponse.End() the application ?
I tried Response.OutputStream.Flush(); but it doesn't seem to work, only
when I follow it with a Reponse.End() , but that's then gonna stop the
server processing what is what I don't want.

Here's my problem : in a button-event handler

void btnSubmitSendback_Click(object sender, System.EventArgs e)
{
byte[] sendData = Encoding.ASCII.GetBytes(strXmlContent);
// strXmlContent contains some info I want the client to save

// Popup a dialog-box at the client
Response.AddHeader("content-disposition","attachment;");
Response.OutputStream.Write(sendData, 0, sendData.Length);

lblStatus.Text = "OK";
}
The result is that the client gets a "File Save as..." dlgBox allowing him
to save the contents. OK.
Problem is that not only 'strXmlContent' was saved but the contents of the
HTML-page as well !!

Now, I try to separate the two by :
// first sending the content then clearing the header
Response.AddHeader("content-disposition","attachment;");
Response.OutputStream.Write(sendData, 0, sendData.Length);
Response.OutputStream.Flush();
Response.ClearHeaders();
lblStatus.Text = "OK";

but it doesn't work. I tried lots of other things, as well using
Response.ClearContent() but nothing works.
Using Response.End() after the Response.OutputStream.Write(...) will show
the popup but will not return my new page. (so the client doesn't see
"OK")

Anyway, either the new page is shown to the client but then no popup
appears, or the client gets a popup but the info saved contains the
html-code of the page as well.

So, actually do I want to send some info to the client enabling him to
save
the
info (and nothing else) via a popup, and as well do I want to show the
client the
refreshed page.

Any help GREATLY appreciated

Chris

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brad Tilley | last post by:
Anyone know of a small Python script that acts as a slimmed down smtp server (just sends from the local machine)? I currently use a smtp server for sending email reports from machines, but as...
5
by: Boris Nikolaevich | last post by:
This is backwards of what I usually want--normally if you have a long-running ASP script, it's a good idea to check to see whether the client is still connected so you can cancel execution. ...
2
by: Lisa Pearlson | last post by:
Hi, My php application (on Apache/Linux) needs to do the following: The PHP script receives a request from a client (binary), asking for certain records of data. My PHP script loops through...
1
by: 1388-2/HB | last post by:
Is JavaScript able to send/listen for data on a specific port? I'm seeking a solution to real time data interaction with my web server that doesn't require refreshing the page. I.e., a chat room,...
2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
16
by: Ed Bitzer | last post by:
Trying to send groups of email with program using System.Net.Mail. I do not clear MailMessage but repeatedly loop changing only the Bcc entries. Works fine if all addresses are valid. As a simple...
0
by: Xionbox | last post by:
Hello everybody, The error I have seems very easy to solve, but for some odd reason I can't seem to solve it. Anyways, here's my "setup". I created a server running on localhost:1200 (telnet...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.