3

I am using ASP.NET MVC 3 with C# and I am having a process that takes about 10 minutes to be finished. I need some help how could I show some interface (progressbar, etc).

What would happen if user turned the browser off? My process should not be stopped.

What would happen if another user tried to open the process page?

I started searching about jQuery progress bar but got those questions and looking for some help.

Thank you

Hamid
  • 289
  • 1
  • 5
  • 12
  • 1
    Maybe worry about the logic of this before pimping it with a progressbar. What kind of results does this produce? Some users will disconnect. – H H Aug 01 '11 at 09:29
  • There is no returned values. Only progress bar if possible. – Hamid Aug 01 '11 at 11:28

1 Answers1

1

If your process takes 10 minute to finish, then you must make the work on background, and keep the result somewhere to show it.

First question: What happend if the user close the browser, to solve this, you need to create a system to make the work on backgroud and leave the browser to continue. if can not make a full shedule class to make your works, a simple thead can do the same think - but is less flexible.

Second question: How to avoid the start of a new process page. You can solve this by using mutex. You set a mutex with a specidic name, and you close it when the job done, after 10minute. In the middle if some user try to re-run the same process you see that the mutex is lock and you show him a message to wait.

You need somewhere to keep the result information's, eg, Let say that you make a job of 10 minute, then store the results somewhere and the user see the results and when they are generated and if he like can rerun the procedure.

With this I describe you to not need to fully disable the page, just a message that result still running, or an automatic refresh to the page every 30 seconds to see if they are done.

Aristos
  • 66,005
  • 16
  • 114
  • 150
  • the process will not show any result. I am keeping everything in database and generated data could be displayed (if user wanted to). – Hamid Aug 01 '11 at 11:25
  • Actually, for now, i am using the ASP.Net MVC 3, and this is my first project using it. I already used Mutex some time ago and i think i can do some searches to figure it out. – Hamid Aug 01 '11 at 11:26
  • The issue for now is: how to make the background process? any hints or guidance is highly appreciated :) – Hamid Aug 01 '11 at 11:27
  • @Harmid http://stackoverflow.com/questions/4190907/example-of-asynchronous-page-processing-in-asp-net-webforms-net-2-0/4191007#4191007 but if you search for asp.net threads you can find many. There is also a full project for processing in bacground in asp.net – Aristos Aug 01 '11 at 12:20