Search code examples
javascriptjqueryasp.netupdatepanelblockui

Using UpdatePanel for progress indication


I just red this article http://encosia.com/using-jquery-to-enhance-aspnet-ajax-progress-indication/ It's about adding BlockUI on server-side click.

Here we used UpdatePanel. So i have few questions :

  • Is it possible to use UpdatePanel without ScriptManager?
  • Can i add one UpdatePanel to Master Page and use it on every button click?

My idea is to add some class to button, on click on which i want to show blockUI and use next code :

$('.btn-busy').click(function () {
    $.blockUI({
        message: $('#img-loader'),
        css: {
            border: 'none',
            padding: '5px',
            'background-color': 'transparent',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .6,
            color: '#fff',
            cursor: 'wait'
        }
    });
});

Solution

  • Is it possible to use UpdatePanel without ScriptManager?

    No, it's not.

    Can I add one UpdatePanel to Master Page and use it on every button click?

    Yes, however you're setting yourself up for disaster. Some controls don't work well in UpdatePanel, and you'll find yourself having all sorts of difficult to debug issues with the site. If you're going to use an UpdatePanel (and I recommend you don't) then you should have it as close to the controls that need it as possible in order to minimize those issues.