I’m building a OCR scanning module in my ASP forms webapplication. As you may know a operation like that can take some time. Therefor I’m using a background service application that responds to a message queue that runs the code so the user does not even have to stay on the same webpage.
What I would like to do is inform the user what is going on while the service is running. If lets say the user uploaded 5 documents I would like to see something like this appear in a literal, label or repeater control. These items do not have to be saved in a database and I don’t want then to.
Processing document 1 of 5
Document 1 processed with code 6732842
Processing document 2 of 5
Document 2 processed with code 8732457
Processing document 3 of 5
Document 3 processed with code 8725347
Processing document 4 of 5
Document 4 could not be processed “no OCR string recognized”
Processing document 5 of 5
Document 5 processed with code 4372537
Completed: Processed 4 of 5 documents received
If an error occurred I would like to see something like this
An error occurred. The scanning process has been stopped.
I have some idears but I don’t know what’s the best practice.
Option 1:
I could save above items in a static class and let javascript post every 5 sec. to get
that value via a web method.
Option 2:
I could save above items in the session returning a updated session object when I let JavaScript post every 5 sec. I don’t know if this is available when using a service Application.
If you have any other options (preferably better ones) that would be greatly appriciated.
Thanx in advance.