<script type="text/javascript">
// Get the instance of PageRequestManager.
var prm = Sys.WebForms.PageRequestManager.getInstance();
// Add initializeRequest and endRequest
prm.add_initializeRequest(prm_InitializeRequest);
prm.add_endRequest(prm_EndRequest);
// Called when async postback begins
function prm_InitializeRequest(sender, args) {
// get the divImage and set it to visible
var panelProg = $get('divImage');
panelProg.style.display = '';
// reset label text
var lbl = $get('<%= this.lblText.ClientID %>');
lbl.innerHTML = '';
// Disable button that caused a postback
$get(args._postBackElement.id).disabled = true;
}
// Called when async postback ends
function prm_EndRequest(sender, args) {
// get the divImage and hide it again
$('divImage').hide();
// Enable button that caused a postback
$get(sender._postBackSettings.sourceElement.id).disabled = false;
}
</script>
3条答案
按热度按时间mznpcxlj1#
使用更新工具包的进度:希望这将帮助你
4xrmg8kj2#
我在this article, 3 Different Ways to Display Progress in an ASP.NET AJAX Application中找到了一些JavaScript,可以自己进行更新过程,也可以把它放在页面的任何地方,它可以在页面的任何更新面板中工作。
gpfsuwkq3#
正在从以下位置加载图像:http://loading.io/