.aspx
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server"
ID="LinkButton1"
Text="View File"
CommandName="open"
CommandArgument='<%# eval("filePath") %>'
ToolTip="select to view correspondence">
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
aspx.vb
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
If e.CommandName = "open" Then
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile("\\" + e.CommandArgument.ToString())
Response.Flush()
Response.Close()
End If
If I add target="blank" to the link button, a new window opens but with nothing in it and the following is displayed within the URL
javascript
:__doPostBack('ctl00$ContentPlaceHolder1$GridView1$ctl03$LinkButton1','')
Bookmarks