1

我在 web.config 中有 httponlycookie 为真 ..so 服务器端 cookie 无法在 javascript 中访问以取消阻止 ui .. 是否有任何选项可以在不使用 cookie 值的情况下阻止 ui

阻止和解除阻止 UI 代码:

function blockUIForDownload() {
        $.blockUI();
       var start = new Date().getMinutes();
        var token = new Date().getTime(); //use the current timestamp as the token value            
        $("#<%= download_token_value_id.ClientID %>").val(token);
        $.blockUI();
        fileDownloadCheckTimer = window.setInterval(function () {
            var cookieValue = $.cookie('fileDownloadToken');
            if (cookieValue == token) {
                window.clearInterval(fileDownloadCheckTimer);
                $.removeCookie('fileDownloadToken'); //clears this cookie value
                $.unblockUI();
                var end = new Date().getMinutes();
                var time = end - start;
                //alert('Execution time: ' + time +' minutes');
            }
        }, 1000);
    }
4

0 回答 0