web 2.0

Disable Control When Asp.net AJAX is in progress

If the AJAX call to the server take too much time, then there is a possibility that user might press some other buttons or some other event occurred which will cause your AJAX call to stop and make a new request.

To overcome this situation, I decided to have div on the top of the page so that while AJAX call is in progress user cannot do any thing else.

So I simply Drag and Drop a Update Progress Control and write the following stuff.

<asp:UpdateProgress ID="UpdateProgress1" runat="server">
    <ProgressTemplate>
        <div id="Progress">Please wait ......</div>
       <div id="bgDiv"></div> 
    </ProgressTemplate>
</asp:UpdateProgress>

And add the following style on head section of the page.

   1: <style>
   2:     #bgDiv {
   3:       position:absolute;
   4:       top:0px;
   5:       bottom:0px;
   6:       left:0px;
   7:       right:0px;
   8:       overflow:hidden;
   9:       padding:0;
  10:       margin:0;
  11:       background-color:black; 
  12:       filter:alpha(opacity=50);
  13:       opacity:0.5;
  14:       z-index:500;
  15:     }
  16:     #Progress
  17:     {
  18:         position: absolute;
  19:         background-color:Red;
  20:         width: 300px;
  21:         z-index: 600;
  22:     }
  23:  
  24:  
  25:     </style>

There we go whenever AJAX call made, a background div will appear and on top of that we have our message "Please wait"

Here is the snapshot

image

Comments

Noufil Khan , on 1/28/2009 3:51:37 AM Said:

Noufil Khan

Good Work..

verizon high speed dsl United States, on 8/14/2009 10:26:47 PM Said:

verizon high speed dsl


This is such an informative blog posts! Thank you for sharing some great insights and useful information regarding on how to disable control when ASP.NET AJAX in progress. Just keep it up!

Baby Gender Predictor United States, on 10/26/2009 1:53:24 AM Said:

Baby Gender Predictor

Dude.. I am not much into reading, but somehow I got to read lots of articles on your blog. Its amazing how interesting it is for me to visit you very often.

losing weight naturally United States, on 10/28/2009 6:55:00 PM Said:

losing weight naturally

You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and very broad for me. I am looking forward for your next post, I will try to get the hang

swarovski rhinestones United States, on 10/30/2009 3:08:53 AM Said:

swarovski rhinestones

Couldn?t be written any better. Reading this post reminds me of my old room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thanks for sharing!

Nosdo United States, on 10/31/2009 9:41:57 PM Said:

Nosdo

I was actually looking around for a blog post on this issue, but stumbled across your site on Google! I’m actually quite interested so will keep an eye out for updates Smile

Commercial Juicers United States, on 11/1/2009 4:12:40 AM Said:

Commercial Juicers

Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I'm more of a visual learner,I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I've added you guys to my blogroll. This is a great article thanks for sharing this informative information.. I will visit your blog regularly for some latest post.

credit cards United States, on 11/2/2009 6:16:47 AM Said:

credit cards

Admiring the time and effort you put into your blog and detailed information you offer! I will bookmark your blog and have my children check up here often. Thumbs up!

Grey's Anatomy Season 6 Episode 9 United States, on 11/5/2009 5:48:29 AM Said:

Grey's Anatomy Season 6 Episode 9

Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I'm more of a visual learner,I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I've added you guys to my blogroll.

Free Online Games United States, on 11/6/2009 3:33:00 PM Said:

Free Online Games

I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.

Linda Mirano United States, on 11/11/2009 6:57:39 AM Said:

Linda Mirano

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.

Amik United States, on 12/1/2009 7:24:27 PM Said:

Amik

Great looking site! Maybe you should use ads from Prosperent network. They pay based on sales not a clicks!!! That means way better money than adsense or any PPCSmile If you are interested send me an email. I will send you invitation code. Cheers.

cocktail dresses United States, on 12/12/2009 1:15:18 AM Said:

cocktail dresses

If you are interested send me an email. I will send you invitation code. Cheers.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading