473,378 Members | 1,631 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,378 software developers and data experts.

How: Sending responses during processing time

Hi folks,

I got a problem that certainly someone had too.

After a user request, I (my server) must process a lot of data that will expend some time. During this process I must inform the user the status of the overall process.

What I'm facing is that my ASPX/vb file that does this long task is completely processed before some response could be given to the user.

Result: After filling the form, the user clicks the button and the form remains on the screen while processing time and the user is not sure that the process is running or even if it was fired.

I've tried some ideas like
- using response.write/response.flush
- Using server.transfer/server.execute

but they didn't work. Someone have some good idea????

Thanks in advance

Luiz

Nov 17 '05 #1
2 1481
Gee - in a desktop application, you would probably use threading, but you
really can't safely do asynchronous programming in web applications, in my
opinion.

I think if I were you, I would look at the architecture, rather than the
cosmetics of a long operation. What can you do so that the user isn't held
up on the page? What if you encapsulate the processing functionality in a
component that can be triggered via an MSMQ message? Then you don't need to
keep the user waiting, and the long processing work is put behind the scenes
to process in its own due course (really this is asynchronous programming,
just without threading.)

If the long operation results in data displayed to the screen, one trick you
can do is to put the processing function in a second page. Put the call to
the processing functionality somewhere in the rendered html, so that the
processing only starts after something displays to the user indicating work
in process.

Something like this.

<%# Page Language=C# %>
<script runat=server>
private void DoSomeBigThing()
{
//lots of hard stuff
}

</script>
<html>
<head/>
<body>
<p>Working...</p>
<% DoSomeBigThing(); %>
<p> etc....</p>
</body>
</html>
"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
Hi folks,

I got a problem that certainly someone had too.

After a user request, I (my server) must process a lot of data that will
expend some time. During this process I must inform the user the status of
the overall process.

What I'm facing is that my ASPX/vb file that does this long task is
completely processed before some response could be given to the user.

Result: After filling the form, the user clicks the button and the form
remains on the screen while processing time and the user is not sure that
the process is running or even if it was fired.

I've tried some ideas like
- using response.write/response.flush
- Using server.transfer/server.execute

but they didn't work. Someone have some good idea????

Thanks in advance

Luiz
Nov 17 '05 #2
Richard,

thanks for Your time....

I studied the case of rearrange the code to turn things faster, but the most part of this processing time is preparing individual and personalized messages to send by IIS SMTP to all customers.

On ASP I used to write (response.write) a dot (".") for each mail sent and it was fine...

Your Idea of putting the code using <script runat=server> is nice because turns the thing closer to ASP processing, I will try that.

Maybe I should figure out how to prepare this e-mails on other way.

Thanks again

Luiz


"Richard K Bethell" <so*****@spammingisevil.bad> escreveu na mensagem news:Ol**************@TK2MSFTNGP12.phx.gbl...
Gee - in a desktop application, you would probably use threading, but you
really can't safely do asynchronous programming in web applications, in my
opinion.

I think if I were you, I would look at the architecture, rather than the
cosmetics of a long operation. What can you do so that the user isn't held
up on the page? What if you encapsulate the processing functionality in a
component that can be triggered via an MSMQ message? Then you don't need to
keep the user waiting, and the long processing work is put behind the scenes
to process in its own due course (really this is asynchronous programming,
just without threading.)

If the long operation results in data displayed to the screen, one trick you
can do is to put the processing function in a second page. Put the call to
the processing functionality somewhere in the rendered html, so that the
processing only starts after something displays to the user indicating work
in process.

Something like this.

<%# Page Language=C# %>
<script runat=server>
private void DoSomeBigThing()
{
//lots of hard stuff
}

</script>
<html>
<head/>
<body>
<p>Working...</p>
<% DoSomeBigThing(); %>
<p> etc....</p>
</body>
</html>


"Luiz Vianna" <lv*****@multconnect.com.br> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
Hi folks,

I got a problem that certainly someone had too.

After a user request, I (my server) must process a lot of data that will
expend some time. During this process I must inform the user the status of
the overall process.

What I'm facing is that my ASPX/vb file that does this long task is
completely processed before some response could be given to the user.

Result: After filling the form, the user clicks the button and the form
remains on the screen while processing time and the user is not sure that
the process is running or even if it was fired.

I've tried some ideas like
- using response.write/response.flush
- Using server.transfer/server.execute

but they didn't work. Someone have some good idea????

Thanks in advance

Luiz

Nov 17 '05 #3

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

Similar topics

1
by: Doug Farrell | last post by:
Hi all, I'm trying to build a web page crawler to help us build our websites, which are driven by static pages after they are called the first time. Anyway, I can use urllib2.urlopen() no...
18
by: Anchorman | last post by:
I have no idea where to start on this. We have a need to allow our users to enter Credit Card #'s on a web page, so we need a secure page (have the little lock at the bottom of the browser) in...
0
by: Yeongja_Choi | last post by:
How Dare Could America Industrial Property Office Be In Conspiracy With Jungang International Patent Office To Make An Extravagant International Crime ? Currently a Korean party now holds the...
6
by: Chris | last post by:
Hi, I have a service that collects messages form MSMQ to enter to a database. What I notice is that if at the same time, during the process of sending the queued message data to the database, I...
0
by: FatboyCanteen | last post by:
I have a page when it starts loading, it will perform a long time process! So, the Page is empty during this time. I want to add a Processing Message, eg Processing. Processing.. Processing... ...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
7
by: toton | last post by:
Hi, I have a STL vector of of characters and the character class has a Boost array of points. The things are vector<Characterchars; and class Character{ private: array<Point,Npoints; }; Now...
1
by: Rob | last post by:
Hi, I've developed a basic dialog program using the MFC foundation wizard. Upon pushing one of the buttons, a time consuming processing is invoked, during which the user cannot access the...
6
by: homevista | last post by:
PART III: Putting things together In part I we examined the modem to verify that it supported voice. If so, we took a note about the voice data format that we would use. In the second part, we...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.