I put an Ajax panel on my page but now downloads do not work, I know is cause of the response.write stream. I s there a way to get around this in the code behind of the itemCommand. The downloads are in a sub grid of my main grid so I cannot take it out of the ajax panel.
<
DetailTables
>
<
telerik:GridTableView
DataKeyNames
=
"intUploadId"
Name
=
"SubGrid"
Width
=
"50%"
TableLayout
=
"Fixed"
Font-Size
=
"10"
AutoGenerateColumns
=
"False"
SkinID
=
"Web20"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"intWarrantyNumId"
MasterKeyField
=
"intWarrantyNumId"
/>
</
ParentTableRelation
>
<
HeaderStyle
Font-Bold
=
"true"
HorizontalAlign
=
"Center"
/>
<
ItemStyle
HorizontalAlign
=
"Center"
/>
<
AlternatingItemStyle
HorizontalAlign
=
"Center"
/>
<
Columns
>
<
telerik:GridTemplateColumn
HeaderText
=
"File"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkDelete"
runat
=
"server"
CommandArgument='<%# Bind("intUploadId")%>' CommandName="DeleteDoc" OnClientClick="return confirm('Are you sure you want to delete this attachment');">
<
asp:Image
ID
=
"imgDelete"
runat
=
"server"
ImageUrl
=
"~/Images/Delete Circle Small.png"
BorderStyle
=
"None"
/>
</
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"File"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkFile"
runat
=
"server"
Text='<%# Bind("strLocation")%>' CommandArgument='<%# Bind("strLocation")%>' CommandName="Download"></
asp:LinkButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
If (e.CommandName = "Download") Then
Dim filename As String = e.CommandArgument.ToString
'Dim path As String = Server.MapPath("~/RMAUploads/" & filename)
Dim targetfolder As String = "\\" & ServerName & "\iPBR\Warranty\" & filename
Response.AddHeader("Content-disposition", "attachment; filename=" & filename)
Response.ContentType = "application/octet-stream"
Response.WriteFile(targetfolder)
Response.End()
End If