I have a vb.net app that is required to open a pdf when the user clicks a link in a gridview..
The handler in the rowCommand event for the gridview fires, but I can't get the pdf to actually open...
This one is driving me nuts....
Error = "The thread was being aborted"
If I comment out the "Response.end()" there's no error, but no document opening either...
Here's the relavent code snippet....
Dim client As New WebClient()
Dim buffer As [Byte]() = client.DownloadData(strFileName)
Dim fileName As String = "EmploymentContract.pdf"
Response.Buffer = True
Response.ContentType = "application/pdf"
Catch ex As Exception
Session("errorMessage") = "FileName = " & strFileName & " -- " & ex.Message
I've tried it in both Chrome (preferred) and IE with the same results...
If I manually paste the file path into chrome the pdf opens without a hitch..
Can anyone shed any light on this please?
Thasnks in advance..