This is just a test page so I can see what the work indicator looks like, but the damn UpdateProgress isn't showing up at all...
The test just builds a list of objects and populates the listbox while the listbox has less than 100 items in it.
<asp:UpdatePanel runat="server" ID="UpdatePanel">
<ContentTemplate>
<asp:Button runat="server" ID="TestButton" OnClick="TestButton_Click" CssClass="btn btn-primary" Text="Begin Test" />
<asp:ListBox runat="server" ID="LicensesListBox" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress runat="server" ID="UpdateProgress" DisplayAfter="10" AssociatedUpdatePanelID="UpdatePanel">
<ProgressTemplate>
<div id="modal">
<div class="modal-content">
<div class="header">
<h2>Working...</h2>
</div>
<div class="copy">
<p><i class="fas fa-spinner"></i></p>
</div>
</div>
<div class="overlay"></div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
And the code-behind:
protected void TestButton_Click(object sender, EventArgs e)
{
// Change the button so we know that work is being done.
TestButton.Enabled = false;
var fixture = new Fixture();
fixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList()
.ForEach(b => fixture.Behaviors.Remove(b));
fixture.Behaviors.Add(new OmitOnRecursionBehavior());
do
{
// Sleep the thread in case the work is getting done too quickly.
Thread.Sleep(10000);
// Create the license objects.
var licenses = fixture.CreateMany<License>();
foreach (var license in licenses)
{
// Add the license to the listbox.
LicensesListBox.Items.Add(new ListItem(license.Name));
}
}
while (LicensesListBox.Items.Count < 100);
}
With the 10 second sleep I'd have expected this to trigger the UpdateProgress to show but nothing at all happens.
There aren't even errors in the console for me to work from.
Here's the CSS for the modal if there's any thought that this is causing problems displaying the ProgressTemplate:
#modal {
left: 50%;
margin: -250px 0 0 -32%;
opacity: 0;
position: absolute;
top: -50%;
visibility: hidden;
width: 65%;
box-shadow: 0 3px 7px rgba(0,0,0,.25);
box-sizing: border-box;
transition: all .4s ease-in-out;
-moz-transition: all .4s ease-in-out;
-webkit-transition: all .4s ease-in-out
}
#modal:target {
opacity: 1;
top: 50%;
visibility: visible
}
/* custom modal css */
#modal .header {
border-bottom: 1px solid #1ABC9C;
border-radius: 5px 5px 0 0
}
#modal h2 {
margin: 0;
}
#modal .copy, #modal .header {
padding: 10px;
}
.modal-content {
position: relative;
z-index: 20;
border-radius: 5px;
color: #fff
}
#modal .overlay {
background-color: #000;
background: rgba(0,0,0,.8);
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 10
}
/* spinner */
.copy i {
-webkit-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-moz-keyframes spin {
100% {
-moz-transform: rotate(360deg);
}
}
@-webkit-keyframes spin {
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
And here's a fiddle to demonstrate more or less what I'm expecting: https://jsfiddle.net/aemk31vL/