tags:

views:

36

answers:

2

I've developed a web application in ASP.NET and one of the things the user can do is a long task. Basically, this task will collect all data in the database and convert it to a specific XML format. This XML is then stored in the database again as a "snapshot" of the data. (So, it doesn't return the XML to the user.)

Unfortunately, this task takes several minutes to process. This isn't a real problem, except the user might become impatient and might try to make a second and even third snapshot simply because nothing seems to be happening.

So I need a simple way to provide a simple feedback to the user, notifying him about the current action so he knows the application is doing something. The Snapshot builder already contains an event which will generate messages about it's current actions so all I need to do is find a way to connect this event to a way to provide live feedback to the user.

Unfortunately, I cannot use third-party components, only the things that are part of VS2008. (Management is extremely worried about possible licensing problems with third-party code.) So I have to write something myself, in Ajax.

I am a very experienced Programmer. Still, this will be my first Ajax project so I need a clear explanation of it's workings. So, how do I provide such feedback to the user in simple-to-understand steps?

+2  A: 

To use AJAX for this request then you should take a look at the UpdateProgress control and set the AssociatedUpdatePanelID to an Id of an UpdatePanel on the page that initializes the long-running process.

Here is a good example of using the UpdatePanel

Here is a Visual Studio solution demonstrating how to use UpdateProgress and UpdatePanel together

I once had a similar problem in a project before AJAX was available and I solved it by using the BusyBox which turned out to work quite nicely in my application.

armannvg
+2  A: 

Well, since you are new, I wouldn't push you hard to learn advanced more efficient ways but you can use UpdateProgress in asp.net ajax library. When ajax is doing something at background UpdateProgress will show a custom message to inform users that the page is doing something.

So you can basically use UpdatePanel to enable ajax in your asp.net page and UpdateProgress to show progress to users.

You can find more information in video format : http://www.asp.net/learn/ajax-videos/

But if you want to advance in learning different ways :

I wouldn't recommend you to use Microsoft ways to enable Ajax in your asp.net pages, instead you can use jQuery ajax and web services in your page to serve more efficient and faster pages.

More : jQuery Ajax Library

Microsoft Visual Studio is providing Intellisense for jQuery so writing code in JQuery is even easier now.

P.s : What I recommended you are totally free and open source.

Braveyard
I myself have no problems using open-source but the final product is a closed-source project that we might distribute to others. Thus, we need to be extra careful about possible licensing conflicts. As a result, we don't use any third-party products without the approval by management. (Doesn't matter if it's open-source or not; they want to check it's license first.)
Workshop Alex