I wrote download excel file in my code. If I click download button I need show ajax-load image (pnlPopup panel). But it is not displaying. I think because of Some "Response" statements (see below code). Download working fine, but simultaniously I want show loader panel too.
<asp:Panel ID="pnlPopup" runat="server" visible="false">
<div align="center" style="margin-top: 13px;">
<asp:Image runat ="server" ID="imgDownload" src="Images/ajax-loader.gif" alt="" /> <br />
<span class="updateProgressMessage">downloading ...</span>
</div>
Protected Sub btnDownload_Click(ByVal sender As Object, ByVal e As EventArgs) 'Handles btnDownload.Click'
Try
pnlPopup.Visible = True
Dim mSurvey As New Survey
Dim mUser As New User
Dim dtExcel As DataTable
mUser = CType(Session("user"), User)
dtExcel = mSurvey.CreateExcelWorkbook(mUser.UserID, mUser.Client.ID)
Dim filename As String = "Download.xls"
InitializeWorkbook()
GenerateData(dtExcel)
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", filename))
Response.Clear()
Response.BinaryWrite(WriteToStream.GetBuffer)
Response.End()
Catch ex As Exception
Finally
End Try
End Sub