After clicking a button on my ASP.NET page, it gets disabled to prevent double clicking and triggers the following 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
After the data is exported to Excel, I need to re-enable the button on the client-side. How can I achieve this?