Lock / fade screen during postback

2

I know that to effect this blocking / fading effect I can use JavaScript or some AJAX component.

I find this kind of care interesting to prevent the user from clicking on the same button several times, which can cause problems. In addition to giving an indication that processing is still occurring.

What would be the most appropriate approach, JavaScript, AJAX or is there another way?

    
asked by anonymous 26.11.2014 / 20:08

2 answers

2

Being a web application, necessarily with javascript and ajax, one complements the other. You can use plugins like jquery.UI to make it easier!

    
26.11.2014 / 20:26
3

One approach you can try is to place all of your controls that the user can interact with in a UpdatePanel ". This takes care of the Ajax part, since the controls for Ajax encase the whole logic of communication with the server.

At the click of a button that is within UpdatePanel and you do the postback, you call a Javascript function that does something like:

  • Create a semi-transparent div that covers your content (probably with absolute or fixed positioning).

    protects the other controls under it from clicks;

  • assign a color to this div , or disable all controls, or anything else that gives the user the idea that the controls are not usable at the moment

  • Finally, when the postback response comes, you call another javascript function that undoes what was done in the above steps.

26.11.2014 / 20:24