I have an UpdateProgress control, that shows as an overlay (using CSS) for all async events for an update panel. Now, for certain EXPAND/COLLAPSE row command events, i just dont want to show that updateprogress.
Is there a way?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
<script type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_initializeRequest(InitializeRequest);
function InitializeRequest(sender, args) {
var updateProgress = $get('UpdateProgress1');
var postBackElement = args.get_postBackElement();
if (postBackElement.id == '<%= Button1.ClientID %>') {
updateProgress.control._associatedUpdatePanelId = 'dummyId';
}
else{
updateProgress.control._associatedUpdatePanelId = null;
}
}
</script>
Method 2
I found this works for me where a Response.Redirect prevents the original page being reloaded & therefore the UpdateProgress does not get turned off..
On the offending control add
OnClientClick="disableProgress()"
and then put this javascript on the page
<script type="text/javascript">
function disableProgress() {
var updateProgress = $get('<%=UpdateProgress1.ClientID%>');
var originalID = updateProgress.control._associatedUpdatePanelId;
updateProgress.control._associatedUpdatePanelId = 'dummyId';
setTimeout(function () { updateProgress.control._associatedUpdatePanelId = originalID; }, 1000);
}
</script>
This temporarily disables the UpdateProgress control and then asynchronously reactivates it client-side after 1 second.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0