AJAX and progress

M

Matt

I know im coming to this party really late, but I have finally beein
expiramenting with AJAX on some ASP development. I seem to have things
working the way I want with one exception. I have a button that fires server
side code for the on-click event. This process time is variable, and I need
to be able to show the user a wait time or at least an updating status as to
the stage of processing (not just a silly non-dyanamic graphic that every
tutorial wants to show).

Inside the server side event, I figured I would just add items to a AJAX
enabled listbox to give the user an idea of where the processing is currently
at. (Started...Working..xxxx # of records processed, finalizing.., etc).
I've added the code to add the items at various stages of the processing, and
figured that databinding the listbox control located in an update panel would
show the items. Unfortunately, that's now the result i get. Until the
button's event completely finishes, the listbox control (located in a
separate update panel) does not update (and of course then I get all the
statuses at once...). Waiting until the end of the function to interact with
the user is what I was trying to avoid.

Am I missing something obvious? I assume I could call an async function
inside the buttons on click event, and then have an AJAX control on the page
poll a db for a status, but I don't think it should be that hard. Can
someone help point me in the right direction?

Thanks! -Matt
 
B

bruce barker

you are correct, you need to poll. the update panel works by sending
all the formdata to the server, running the page process, then sending
back the html to render in the update panels. also the ajax poll needs
to not use session, as session requests are processed serially.

-- bruce (sqlwork.com)
 
N

NH

Actually my suggestion is of no use if you want to the "stage of processing".
Not sure how you are going to know that.
 
M

Muqadder

Well, AJAX does have the UpdateProgress control but configuring that will
depend on HOW you are progerssing through the stages and show the state (how
do you know what stage r u at??). You can, however, create andother thread
which will keep adding some seconds to the progress and display it on the
page, thus de-coupling the CLick event of button from progress display.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top