简体   繁体   中英

drop down list with jquery and blockui

I almost figure this out, can anyone tell me as to why my $.unblock never executes?

$(document).ready(function () {
    $('#somedropdown').change(function () {
        $.blockUI({
            css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: '.5',
                color: '#fff'
            }
        });

        var dropdownvalue = $('#somedropdown').val();
        var xaml1obj = document.getElementById("Xaml1");
        $.getScript(xaml1obj.Content.scriptableObject.InitializeSomething(dropdownvalue), function () { $.unblockUI(); });
    });
}); 

The solution to this was to call unblock method from the managed code (C# to javascript). In other words, when you make a selection you call block, do your work (ie call server, etc) and then call unblock at the end. The calls to block and unblock are made from managed code (c#) but the actual work is performed in the javascript (because this is jQuery)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM