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

Showing "Template" + feedback for a page that takes a long time toprocess.

Like many sites, mine has a standard "look" -- a template, if you will
-- that visitors see on each page. I've tried to keep the code and HTML
separate to the extent possible, and for most standard page
presentations, it works well.

However, I have a couple of screen scrape / import routines that can
take minutes, even hours, to complete. I'd like to have some way of
outputting my template first to the browser, and then within the
template, providing feedback to the user as the import progresses. I've
yet to figure out how to do this. If I do, e.g. ... (pseudo code)

<script runat="server">

Response.Write(userfeedback);
Response.Flush;
</script>

....from within the code, I can provide good feedback, but these lines
will end up in the browser before any the rest of the template arrives.

If, instead I do, e.g. ... (pseudo code)

<script runat="server">
StringBuilder sb = new Stringbuilder();
sb.Append(userfeedback);
myControl.Text = sb.ToString();
</script>
<html>
<body>

<asp:Literal id="myControl" runat="server" />
</body>
</html>

....I may have to wait a very long time before seeing anything on the screen.

Is there any way to output the template first, and then target my
Response.Write/Response.Flush statements to, say, a <div> or some kind
of <asp:n> control?

Thanks for any input!

--Brent
Nov 19 '05 #1
2 1562
this is probably a bad approach. minutes is sorta ok, hours is too long, the
browser will shut down. also if the user get bored, and quicks, your
execution will abort. you shoudl swich to a queueing syatem where the page
queues up the request, then polls for the results. this means if it runs for
1/2 hour, the user can go away, come back and check the status.

your current approach is push content to the browser and have it rendered
right away. this will work as long as the markup is simple. if you
processing message appear in a table, then the browser will wait for the end
tags of the table before rendering, and thus defeat you purpose. if you want
header to apper try this:

<html>
<!-- all my template stuff -->
<script runat=server>
DoLongRunngProcess();
</script>
<!-- more template stuff>
</html>

in DoLongRunngProcess(), call Response.Write(), Response.Flush() to output
your processing messages. be sure page Buffering is turned off. remeber if
the template is too complex the browser may not render until all html has
been received.
-- bruce (sqlwork.com)



"Brent" <""b b i g l e r \"@ y a h o o . c o m"> wrote in message
news:11*************@corp.supernews.com...
Like many sites, mine has a standard "look" -- a template, if you will --
that visitors see on each page. I've tried to keep the code and HTML
separate to the extent possible, and for most standard page presentations,
it works well.

However, I have a couple of screen scrape / import routines that can take
minutes, even hours, to complete. I'd like to have some way of outputting
my template first to the browser, and then within the template, providing
feedback to the user as the import progresses. I've yet to figure out how
to do this. If I do, e.g. ... (pseudo code)

<script runat="server">

Response.Write(userfeedback);
Response.Flush;
</script>

...from within the code, I can provide good feedback, but these lines will
end up in the browser before any the rest of the template arrives.

If, instead I do, e.g. ... (pseudo code)

<script runat="server">
StringBuilder sb = new Stringbuilder();
sb.Append(userfeedback);
myControl.Text = sb.ToString();
</script>
<html>
<body>

<asp:Literal id="myControl" runat="server" />
</body>
</html>

...I may have to wait a very long time before seeing anything on the
screen.

Is there any way to output the template first, and then target my
Response.Write/Response.Flush statements to, say, a <div> or some kind of
<asp:n> control?

Thanks for any input!

--Brent

Nov 19 '05 #2
Thanks, Bruce.

Do you have a place I can learn about queuing and polling? Sounds like a
better option!

--Brent

Bruce Barker wrote:
this is probably a bad approach. minutes is sorta ok, hours is too long, the
browser will shut down. also if the user get bored, and quicks, your
execution will abort. you shoudl swich to a queueing syatem where the page
queues up the request, then polls for the results. this means if it runs for
1/2 hour, the user can go away, come back and check the status.

Nov 19 '05 #3

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

Similar topics

6
by: DJ Majestik | last post by:
OK, I am devising a php page that will handle a form submission, and wanted to know if anyone has already setup such an idea, or if you had links to point to good tutorials on this. Basically I...
0
by: Gianni Mariani | last post by:
I remember seeing a neat template specialization trick posted here a few months ago that allowed the detection of a type containing a member. After a day searching through google archives I come up...
10
by: Lionel B | last post by:
Greetings, I cannot figure out why the following code does not compile: --- BEGIN CODE --- typedef double ftype(double); struct A {
5
by: Jacky Yuk | last post by:
Hi all, I am new to c++ but using c for long time. Recently, I created a MFC GUI project by VC/C++ 6.0. Everything was fine until I wanted to use "template": template <typename T> class...
2
by: Rudy Ray Moore | last post by:
Whenever I get any error with Vc++7.1/.net/2003, it is followed by huge ammounts of "template assistance" error messaging referencing template code (MTL) that has nothing to do with the error. ...
9
by: Kobe | last post by:
Is there any difference in: template <class T> vs. template <typename T> ?
0
by: Robbie Hatley | last post by:
I'd always thougth that a C++ compiler/linker should be able to instantiate a template in mulitple places (say, in two different translation units), even using the same template parameters so that...
2
by: Robbie Hatley | last post by:
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote: > Robbie Hatley wrote: > > > > I ran into a problem a few days ago when I added a couple of > > template functions to one of my personal...
4
by: Gary li | last post by:
Hi, all I find "template template" class cann't been compiled in VC6 but can ok in Redhat9. I write a test program like as: template< template<class> class T> class A { }; int main() {...
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?
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...
0
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,...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.