Torna al Thread

Protected Sub lkbScarica_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbScarica.Click If (DownloadFile()) Then 'salvo da qualche parte che ha finito... End If End Sub Protected Function DownloadFile() As Boolean Dim blOk As Boolean = True Try HttpContext.Current.Response.ClearContent() HttpContext.Current.Response.ClearHeaders() HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=" + sNomeFileZip) HttpContext.Current.Response.ContentType = "application/zip" HttpContext.Current.Response.WriteFile(sNomeFileFullPathZip) HttpContext.Current.Response.End() Catch exTread As System.Threading.ThreadAbortException blOk = True Catch ex As Exception blOk = False End Try Return blOk End Function
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5