I created this code with the intention that, when clicked on, this ImageButton will redirect the PDF to a new tab/new window. Unfortunately it does not work. When I clicked on the ImageButton it passed to current tab/window. Please help.
<asp:ImageButton ID="ImageButton14" runat="server" Height="16px"
ImageUrl='image/viewIcon.png' target="_blank"
CommandName="openpdf" CommandArgument='<%# Bind("modul_filePath") %>'/>
Code behind:
If e.CommandName = "openpdf" Then
Dim modul_filePath As String = e.CommandArgument.ToString()
Using myConnection
myConnection = New SqlConnection(xxxxxxx)
' ...
End Using
strPath = modul_filePath
Response.ContentType = "application/pdf"
Response.Redirect("" + strPath.Trim)
Response.End()
End If