Hi
Naveen,
You have to define
ControlID={You linkbutton ID} in <triggers>
<asp:UpdatePanel runat="server" ID="upFiles" UpdateMode="Conditional">
<ContentTemplate>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="gvNewFiles" />
</Triggers>
</asp:UpdatePanel>
Please use following code to Download file:
Public Shared Function DownloadFile(ByVal filePath As String) As Boolean
Try
If File.Exists(HttpContext.Current.Server.MapPath(filePath)) Then
Dim strFileName As String = ""
strFileName = System.IO.Path.GetFileName(HttpContext.Current.Server.MapPath(filePath))
strFileName = strFileName.Replace(" ", "%20")
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" & strFileName)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.WriteFile(HttpContext.Current.Server.MapPath(filePath))
HttpContext.Current.Response.End()
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
Please do let me know, if you have any doubt.
Please provide "
Vote":thumbsup: if this would be helpful, and make "
Accept Answer" if this would be correct answer.:rose:
Thanks,
Imdadhusen