Informing client of progress via code-behind

M

MarkusJ_NZ

Hi, I have a website where a person can upload a CSV and all the
records are displayed in a gridview.

If the records are correct then I iterate through each row and create
a business object for each row and save the record to the database;
this is working fine.

My problem is that the client has no idea about the progress or how
many records have been saved or are left to save to the database.

What I would like to do is each time the .Save() method is called on
my business object show a message via the users browser that "Record
Joe Bloggs has been saved to the database."

I would also like to be able to do this if a person uploads a CSV and
I bind this CSV to a datatable (e.g. no datagrid). In this instance, I
would just iterate through the datatable saving records and showing
the progress to the user.

Any ideas welcome
Regards
Markus
 
S

Scott M.

The thing to remember is that the browser receives messages from the server
AFTER the server is done processing the page and its code. The only way you
are going to be able to give the browser progress reports is by having the
client download and install some time of upload manager, which would
essentially be a client application.

-Scott
 
M

MarkusJ_NZ

The thing to remember is that the browser receives messages from the server
AFTER the server is done processing the page and its code.  The only way you
are going to be able to give the browser progress reports is by having the
client download and install some time of upload manager, which would
essentially be a client application.

-Scott











- Show quoted text -

Hi Scott, yes, I thought as much, thanks for your help

Regards
Markus
 
R

Ralph

Hi Scott, yes, I thought as much, thanks for your help

Regards
Markus

There are ways to do this it depends on how much you want to change
your app.
You could have a status table in your database where your process
periodically writes what it is doing.
Then you could have a button on your page that a user can press that
would cause the page to read the status.
On completion the page could just redirect to the page you want the
user to see when the app is completed.
You can use the javascript settimeout, or ajax to automatically
refresh the page at certain intervals.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top