Lock/fade screen during postback

Asked

Viewed 546 times

2

I know that to effect this block/fade effect I can use Javasscript or some AJAX components.

I find interesting this type of care to avoid the user keep clicking several times on the same button which can generate problems. In addition to giving an indication that processing is still taking place.

What would be the most appropriate approach, Javascript, AJAX or otherwise?

2 answers

3

One approach you can try is to put all your controls with which the user can interact on one UpdatePanel. This takes care of the Ajax part, since the controls for Ajax encapsulate all the communication logic with the server.

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

  • create a div semi-transparent covering its contents (probably with absolute or fixed positioning). A div protects the other controls under it from clicks;

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

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

  • 1

    I use the Updatepanel so I’d be on my way. Only I had problems with download button inside the Updatepanel, I had to put out of it, because it was not working. From what I understand it only works with cotroles among Updatepanel. The idea would be to play a div to block the entire screen without needing to disable the controls. I even managed to do it with Javascritp, but I wanted to make sure the best way forward.

2


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

  • I even made it with Javascript just want to make sure the best method to avoid rework. I will search about jQuery.UI.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.