I have button on my ASP.NET page which calls gets disabled on click(to prevent double click) and call this function:
Private Sub ExportToExcel(ByVal nameReport As String, ByVal wControl As GridView, ByVal sTitle As String)
Dim responsePage As HttpResponse = Response
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
Dim pageToRender As New Page()
Dim form As New HtmlForm()
wControl.AllowPaging = False
wControl.EnableViewState = False
wControl.DataSource = GetDataSource(False)
wControl.DataBind()
wControl.Caption = "<strong>" + sTitle + "</strong>"
form.Controls.Add(wControl)
pageToRender.Controls.Add(form)
responsePage.Clear()
responsePage.Buffer = True
responsePage.ContentType = "application/vnd.ms-excel"
responsePage.AddHeader("Content-Disposition", "attachment;filename=" & nameReport)
responsePage.Charset = "UTF-8"
responsePage.ContentEncoding = Encoding.Default
pageToRender.RenderControl(htw)
responsePage.Write(sw.ToString())
responsePage.End()
End Sub
Which I use to export some data to Excel. Now I need to re-enable the button on client side when the HttpResponse is finished. How can I do that?