0

I have a button in side update panel

<asp:UpdatePanel ID="updpnlMain" runat="server">
        <ContentTemplate>
<asp:Button ID="btn_dwnld" OnClientClick="ExportHideUpdateProcess"  runat="server" CssClass="btn btn-primary" ToolTip="Download" autopostback="true" Text="Download"></asp:Button>
</ContentTemplate>
    </asp:UpdatePanel>

Update Progress tab is like this

<!--Update progress div starts  -->
    <asp:UpdateProgress ID="updpgrsMain" runat="server" DisplayAfter="1">
        <ProgressTemplate>
            <div class="divWaiting" style="padding-top: 20%;">
                <center>
                        <div>
                        <asp:Label ID="lblWait" runat="server" Text=" Please wait..." Font-Bold="true"
                            Font-Size="Large" />
                        <br />
                        <br />
                        <i class="fa fa-spinner fa-4x fa-spin" style="color:#2e8bcc;"></i></div></center>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>

button used for downloading file from server

 Protected Sub btn_dwnld_Click(sender As Object, e As EventArgs) Handles btn_dwnld.Click
        Dim url As String = ""
        If ViewState("fileD") = "Excel" Then
            url = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.ApplicationPath & "/File/ExcelForm.xlsx" 
            Dim vScript As String = ""
            Response.Redirect(url)
End If

and Script for stopping the busy indicator is as given below

<script type="text/javascript">
function ExportHideUpdateProcess()
{
   setTimeout("HideUpdateProcess()", 1000);
}

function HideUpdateProcess()
{
    var updproc = document.getElementById("<%= updpgrsMain.ClientID %>");
    updproc.style.display = "none";
}
</script>

The Issue is Busy indicator doesn't stop after clicking on buttton i also inspect in browser but the method written OnClientClick="ExportHideUpdateProcess" is not called . Any idea would be appreciated how to close that busy indicator

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Shivam
  • 17
  • 5
  • Do you have `ExportHideUpdateProcess` event handler defined in the code behind? What `btn_dwnld_Click` is for? – Chetan Mar 18 '21 at 02:36
  • @ChetanRanpariya There is no ExportHideUpdateProcess and btn_dwnld_Click is for downloading excel file from server. – Shivam Mar 18 '21 at 02:41
  • Ohh.. Pardon my overlook.... `btn_dwnld_Click` is defined who is invoking it? You might want to do `OnClick = "btn_dwnld_Click"` for `btn_dwnld` ? – Chetan Mar 18 '21 at 02:45
  • https://stackoverflow.com/questions/7704171/asp-net-display-loading-message-while-update-panel-is-updating – Chetan Mar 18 '21 at 02:47
  • https://www.aspsnippets.com/Articles/Show-Loading-Progress-Indicator-using-GIF-Image-when-UpdatePanel-is-updating-in-ASPNet.aspx – Chetan Mar 18 '21 at 02:47
  • You might want to do `AssociatedUpdatePanelID="updpnlMain"` for `updpgrsMain` UpdateProgress – Chetan Mar 18 '21 at 02:49

0 Answers0