473,757 Members | 10,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(userf eedback);
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 1587
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>
DoLongRunngProc ess();
</script>
<!-- more template stuff>
</html>

in DoLongRunngProc ess(), 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.supe rnews.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(userf eedback);
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
1721
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 have a form (which I use smarty templating to display, and smartyvalidator to validate). The php page basically is driven by the action variable (add, add_confirm, edit, edit_confirm, view, delete). When the form starts out, it is in view mode....
0
1876
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 zip. Anyhow, after much trial and error I came up with this. This "contains_member" template sets value to 1 if the type D contains a typedef named MEMBER of type TD.
10
1779
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
3593
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 AutoComPtr { ... The following errors were shown:
2
2019
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. This makes it difficult to spot errors. For example, F4 to "jump to next error" just jumps ot the next "template assistance" message. And since there are hundreds of them, this is quite obnoxious. Can I disable these things? Why is MSVC...
9
3350
by: Kobe | last post by:
Is there any difference in: template <class T> vs. template <typename T> ?
0
1957
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 the resulting functions or classes are identical, without causing any errors. Or so I thought. But a few days ago, I added a couple of new template functions to one of my personal library modules, and I got this linker error message (from...
2
2800
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 library headers. > > > > My library, librh.a > > Linking is not defined by C++ .
4
5081
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() { return 0;
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
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
9906
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
9885
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
9737
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...
0
8737
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3829
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
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.