474,035 Members | 26,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to slowly add content to a web page?

When a user clicks on a button on my aspx page it launches a bunch of
threads which go and do things which might take a few seconds each.
Rather than waiting for all threads to complete before rendering the
response, is there a way to show the current status of each thread?

Ideally the status would be shown in a literal control or a textbox. It
would say maybe "thread started" and on completion "thread completed",
and in no particular order.

This would be analagous to a very slow rendering of the page.

How can this be implemented?

Thanks for your help.
Nov 18 '05 #1
9 1181
I can't even imagine why would you need to open several
threads on a server while it processing the request? One
exception: sending email, but usually it takes no time
anyway.

The simple answer is no. But you can try to redirect user
on the same page with different text attribute of your
control using server timer. Never done this before because
there was no need :)

-----Original Message-----
When a user clicks on a button on my aspx page it launches a bunch ofthreads which go and do things which might take a few seconds each.Rather than waiting for all threads to complete before rendering theresponse, is there a way to show the current status of each thread?
Ideally the status would be shown in a literal control or a textbox. Itwould say maybe "thread started" and on completion "thread completed",and in no particular order.

This would be analagous to a very slow rendering of the page.
How can this be implemented?

Thanks for your help.
.

Nov 18 '05 #2
No. What the client is looking at is the RESULT of the processing that has
already taken place and completed on the server. You can think of it this
way, the web page that the client is looking at is the results from some
process that has already completed and moved on to other things.

Now, if you wanted to get into ActiveX controls or Java Applets, that would
be a different story because those are self-contained executable programs
that are launched from a web page but (once launched) can run independant of
it.
"Bruce W.1" <br***@noDirect Email.com> wrote in message
news:3F******** *******@noDirec tEmail.com...
When a user clicks on a button on my aspx page it launches a bunch of
threads which go and do things which might take a few seconds each.
Rather than waiting for all threads to complete before rendering the
response, is there a way to show the current status of each thread?

Ideally the status would be shown in a literal control or a textbox. It
would say maybe "thread started" and on completion "thread completed",
and in no particular order.

This would be analagous to a very slow rendering of the page.

How can this be implemented?

Thanks for your help.

Nov 18 '05 #3
One solution is to pass the response object as a parameter to each thread.
The thread can freely write to it whenever it starts and whenver it is done.
When you need the screen to update after thread processing you would call
the static flush method on the Response object. Off the top of my head, i'm
not sure if you will run into synchronization issues since it depends on
what part of the response object you manipulate - some methods are thread
safe others are not.

Alternatively, you can use the session object to transfer data from threads
to your main thread. Set up your main page to continuously refresh itself.
With each refresh, you check a session variable flag to determine if there
is data needed to be displayed on screen in the main page. If there is, you
retrieve data from a session variable and display it in the refresh
procedure and call flush on the response object. The session data variables
will be set by the individual threads. You will need to synchronize access.
The idea is roughly equivalent to a splash screen. That should be enough to
get you started.

--
Regards,
Alvin Bruney
Got DotNet? Get it here
http://home.networkip.net/dotnet/tidbits/default.htm
<an*******@disc ussions.microso ft.com> wrote in message
news:00******** *************** *****@phx.gbl.. .
I can't even imagine why would you need to open several
threads on a server while it processing the request? One
exception: sending email, but usually it takes no time
anyway.

The simple answer is no. But you can try to redirect user
on the same page with different text attribute of your
control using server timer. Never done this before because
there was no need :)

-----Original Message-----
When a user clicks on a button on my aspx page it

launches a bunch of
threads which go and do things which might take a few

seconds each.
Rather than waiting for all threads to complete before

rendering the
response, is there a way to show the current status of

each thread?

Ideally the status would be shown in a literal control or

a textbox. It
would say maybe "thread started" and on

completion "thread completed",
and in no particular order.

This would be analagous to a very slow rendering of the

page.

How can this be implemented?

Thanks for your help.
.

Nov 18 '05 #4
"Bruce W.1" <br***@noDirect Email.com> wrote in
news:3F******** *******@noDirec tEmail.com:
When a user clicks on a button on my aspx page it launches a
bunch of threads which go and do things which might take a few
seconds each. Rather than waiting for all threads to complete
before rendering the response, is there a way to show the
current status of each thread?

Ideally the status would be shown in a literal control or a
textbox. It would say maybe "thread started" and on completion
"thread completed", and in no particular order.

This would be analagous to a very slow rendering of the page.

How can this be implemented?


Bruce,

http://www.fawcette.com/vsm/2002_11/...tures/chester/

You should be able to adapt the article to meet your needs by having
a master ("status") thread that spawns and manages the child
("worker") threads.

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 18 '05 #5
"Chris R. Timmons" wrote:

Bruce,

http://www.fawcette.com/vsm/2002_11/...tures/chester/

You should be able to adapt the article to meet your needs by having
a master ("status") thread that spawns and manages the child
("worker") threads.

Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

=============== =============== =============== =============== =

If I understand this right, the results aspx page is just slowly
displaying an XML document, transformed nicely into html.

Similar behavior comes from the display of a large text file, i.e. it
displays as it loads.

So then the million dollar question is, how can this behavior be put in
to an aspx web form? Or can this behavior be put in to an aspx web
form?
Nov 18 '05 #6
"Bruce W.1" <br***@noDirect Email.com> wrote in
news:3F******** *******@noDirec tEmail.com:
If I understand this right, the results aspx page is just slowly
displaying an XML document, transformed nicely into html.

Similar behavior comes from the display of a large text file,
i.e. it displays as it loads.

So then the million dollar question is, how can this behavior be
put in to an aspx web form? Or can this behavior be put in to
an aspx web form?


Bruce,

The output can be in any format you want. Instead of using an
XmlDocument, you could dynamically create ASP.NET web controls, or
insert text or HTML into a literal control.

I've ported the example code to C#, and modified it to use plain text
and a literal control instead of XML for output. If you'd like, I
can zip up the code and e-mail it to you (I'll need your e-mail
address of course). Or I could post it here if anyone else is
interested.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 18 '05 #7
Shouldn't have a problem implementing the suggestions left by others
here if you're also sure to:

- Set the page's BufferOutput property to True
- Called .Flush() after each line you want to output to the client as
the operation progresses.
- Made sure you don't have any open table tags between output. Some
browsers won't render partial tables, whether the output is flushed or not.

Also, remember that if you want to redirect or something after the
operation has completed, you'll need to do it in client script since the
HTTP headers have already been written out. Just a gotcha I've run into.

-----
Aaron Lewis
GuildPortal.com Development
www.guildportal.com

Nov 18 '05 #8
Aaron Lewis wrote:

Shouldn't have a problem implementing the suggestions left by others
here if you're also sure to:

- Set the page's BufferOutput property to True
- Called .Flush() after each line you want to output to the client as
the operation progresses.
- Made sure you don't have any open table tags between output. Some
browsers won't render partial tables, whether the output is flushed or not.

Also, remember that if you want to redirect or something after the
operation has completed, you'll need to do it in client script since the
HTTP headers have already been written out. Just a gotcha I've run into.

-----
Aaron Lewis
GuildPortal.com Development
www.guildportal.com


=============== =============== =============== ===============

That sounds like really good advice and I must try it sometime. But I'm
sorry to say that I have shifted gears and turned it in to a No-Touch
Deployment (NTD) winforms program, and it works great. ASP.NET is not
so great for real-time information.

Of course it only runs on .NET. That's okay for now.

I wish Microsoft would let NTD programs run in an IE browser window.
Nov 18 '05 #9
Yeah I've done a WinForms version of my web-based application, and
working with Windows Forms is so much nicer than with web apps...
Partially because of the "neatness" factor of managing synchronization ,
updating, and offline manipulation of data coming from a series of
remote web services, and using threads to do it. I'm a newbie to a lot
of parts of the .NET framework, so hitting new areas is great fun!

You know what would be REALLY cool, though? If the future version with
the Windows Forms or Avalon or whatever it's called, with the UI mark-up
called XAML (right?), could be portable between windows and web apps.
I mean, a treeview is a treeview right? If I have a Windows Forms app
with a TreeView and a ListView in it, and the output of the form is
XAML, why couldn't IIS or the framework itself see that and render
either a Windows Form or a Web Form, depending upon the context of the
client? THAT would be extremely cool. :)

By the way, about NTD in the browser, have you tried using the OBJECT
tag and referencing the DLL + class name for one of your Windows Forms
in HTML? I hear it works the way old-style OCX would..

-----
Aaron Lewis
GuildPortal.com Development
www.guildportal.com

Bruce W.1 wrote:
That sounds like really good advice and I must try it sometime. But I'm
sorry to say that I have shifted gears and turned it in to a No-Touch
Deployment (NTD) winforms program, and it works great. ASP.NET is not
so great for real-time information.

Of course it only runs on .NET. That's okay for now.

I wish Microsoft would let NTD programs run in an IE browser window.


--

Nov 18 '05 #10

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

Similar topics

2
1939
by: Joshua Beall | last post by:
Hi All, I use register_shutdown_function to register a function that then gets run when the script finishes executing. It worked great before, but sometime last week on my development server all my sites started going very slowly. It is still running fine on the production server (thankfully). Nothing was changed. In fact, I was out of town that week, and the dev server was powered off.
7
1874
by: lawrence | last post by:
This page renders slowly on both IE and Netscape - everything downloads before anything appears on screen. It is the behavior you'd expect if the whole thing was wrapped in a table, yet there is no table. What other sorts of problems normally cause this?
0
1160
by: Asad_Zaidi | last post by:
I have a website developed in ASP.NET and Content Management Server. This site's home page has a textbox which takes say an ID as input. The entered ID is then posted as a querystring to another web application (a ASP.NET application) running on the same IIS to retrieve details from the database for that ID. This other web application opens in a new browser window. My problem is that in the first request i.e. first time when that ID is...
5
1708
by: Samy | last post by:
Hi There, I have a stored procedure which takes 7 sec to execute. I am using a adapter and filling the dataset. Then I bind the datagrid with the datatable from the dataset. When I test the page against the test server DB, the page loads pretty fast. When I test the page against the production server DB, it loads too slowly. The tables against which I am testing are static tables both in the test DB and the production DB. I am unable to...
0
1555
by: Timo | last post by:
My (intranet) aspx page finishes loading but the progress bar continues to advance very very very slowly, i.e. a new chunk on the bar is added 10 seconds or so, and then progress bar stops about halfway and never gets any further. Is there any way to monitor activity on the web server that would give some indication as to what process is still ongoing that makes the browser (IE6) display the progress bar? The page uses a hidden IFRAME to...
9
1699
by: K. Woodward | last post by:
I wouldn't consider myself a newbie, but this problem is making desire nothing more than a sledgehammer and enough money to buy a new computer (but don't kill the messenger, I suppose). I'm trying to make a site-specific javascript prompt box. That is, I need to get info from the user when they click a link to activate an AJAX function. I was using a simple prompt() to get it, but then I looked at my site in aIEe and realized what a POS...
0
2130
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and sets a connection string to the database. The content page has a simple gridview that should show records from the selected database. Initial content page displays data from correct place. first change of dropdownlist correctly updates content...
1
1467
by: 2291980 | last post by:
Hello I have create one page where on perticuler click i am calling 6 js function one after another. this all function are ajax function every thing is working fine . But issue is that it takes lots of time to display data. It takes almost 1 to 1.5 min to display data. can any body help me on that.....
3
14271
by: mthomsit | last post by:
Hi, I have a script which after a time shows the following error in IE: "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive". The page is quite complex and uses ajax to post updates to the server, updating parts of the page based on the response. It uses YUI (event and dom mainly). There are no infinite loops or similar constructs.
0
10522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
12118
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11590
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11969
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11121
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8682
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5387
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4925
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.