On an ASP.NET Web Forms page with multiple UpdatePanels it’s nice to give the user some feedback when one of the panels is being updated, so they know to wait and can also not change any form values in that panel during the update.
In my example screen capture on this page, you can see that the delivery address is being updated and it is greyed out, yet other parts of the page are unaffected.
This is easy to accomplish using an UpdateProgress for each UpdatePanel and some CSS.
Mark upInside each UpdatePanel we need to add an outer DIV (required so that inner elements can be positioned relatively), and then an UpdateProgress with a DIV that is used to block input and create the effect of the area being greyed out.
Optionally we can add an AJAX loader animated GIF to show the user something is going on. This requires a second DIV inside the UpdateProgress.
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="0">
<!--- your content here --->
CSSThe CSS for “update-progress-gif” is only required if adding a AJAX loader image, and the URL would need to be adjusted based on the image file name and location.
I like the free AJAX loader images at www.ajaxload.info.
background: url(/images/ajax-loader.gif) top left no-repeat;
Note that if you have nested UpdatePanels then you should include the UpdateProgress only on the outer UpdatePanel otherwise you will get multiple UpdateProgress controls appearing simultaneously.
by John Avis | May 6, 2020
If you are having intermittent problems sending email in .NET using System.Net.Mail consider switching libraries.
by John Avis | November 4, 2019
As support ends for Microsoft Windows Server 2008 I have recently gone through migrating some websites to a new server running Windows Server 2016 and IIS 10 but some of the websites did not work.
by John Avis | October 15, 2019
For a website project I needed a way to enter multiple tags. I just wanted something simple that I could easily modify to suit my own needs, so I wrote my own.