Dear all,
I am uing the excellent WebAsyncRefreshPanel to good effect to create seemless page transitions. However, in some places, the refresh is so quick that I do not need to show the progress indicator (i.e. I am using the panel to prevent a full post-back of the page). Could somebody show me an example of how I could hide it for certain panels?
I have found various samples in the forums usig Javascript that could provide part of the solution using the getProgressIndicator() method, but I am fairly new to ASP.NET development and JavaScript in particular, so I would really appreciate a full example. For example, how do I get the Javascript to fire? I know this may sound like a trivial question but I am uncertain how it works...
Many thanks in advance,
Ben
Hi Ben,
To modify indicator, you need to use javascript. There is no option to remove indicator completely, however, you may make it invisible, by setting its html to something like " ", " ", "<div></div>", etc. You may modify indicator permanently or readjust it dynamically for specific events. Below are examples to implement ClientSideEvents Initialize and RefreshRequest
<script type="text/javascript">function WARP1_InitializePanel(oPanel){ var pi = oPanel.getProgressIndicator(); pi.setTemplate(' ');}
function WARP1_RefreshRequest(oPanel,oEvent,id){ var pi = oPanel.getProgressIndicator(); if(id == 'Button1') pi.setTemplate(' '); else if(id == 'Button2') pi.setTemplate('<div style="width:100px;background:yellow;">Please wait...</div>'); else pi.setTemplate(null);}</script>
Thanks very much for your swift answer, it's worked well. :)
Regards,