2

I have a page I'm working on and it works correctly in the sense that I press a button and it executes a stored procedure. The problem is the stored procedure takes awhile to complete, and I want the user to know that there is progress being made and that it's not stuck. So is there a good method to give the user some idea of the progress being made? I was going to just simply display an animated gif, but not sure how to do this. Or if there is a more preferred way to do this I'm all ears. Thanks!

daveomcd
  • 5,655
  • 12
  • 72
  • 125

3 Answers3

2

Generally it is a bad idea to have a website command take time, but when you have to Microsoft have an Ajax library which works with ASP.Net - this includes a Progress bar control which can appear when you are doing a long task

The site for the ASP.Net Ajax can be found here; http://www.asp.net/ajax

The Ajax Control Toolkit which includes the progress indicator is here; http://www.asp.net/ajaxlibrary/act.ashx

Paul S Chapman
  • 686
  • 7
  • 32
1

If you do an AJAX call you can use jQuery to show a loading graphic. See this post How to show loading spinner in jQuery?

Community
  • 1
  • 1
user1477388
  • 19,139
  • 26
  • 125
  • 240
1

Yes, you can definitely use an animated .gif to display to the user while the stored procedure is executing. You'll want to use ASP.NET AJAX to accomplish this, specifically using UpdatePanel and UpdateProgress controls.

View the following URL which guides you on implementing the UpdateProgress control: http://www.asp.net/AJAX/Documentation/Live/mref/T_System_Web_UI_UpdateProgress.aspx

The section on "Specifying the Content of the UpdateProgress Control" talks about using the ProgressTemplate to show an animated image that notifies the user of the progress on the page.

--Tyler

Tyler
  • 173
  • 4
  • 8