Hi All,
I have a ajaxified Radgrid, having some columns,
there is one button column for file dowwnload.
when we hit that button
the files from server should get downloaded.
But due to ajaxification, we are not able to download the files.
If i remove the radajaxmanager then i am able to download the files.
protected void GrdDocs_OnItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "Download")
{
GridDataItem item = e.Item as GridDataItem;
string filePath = item["FILEPATH"].Text;
string filename = Path.GetFileName(filePath);
Response.ClearContent();
Response.Clear();
Response.ContentType = "application/zip";
Response.AppendHeader("content-disposition", "attachment; filename=" + filename);
try
{
//RadAjaxManager1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", filePath));
Response.TransmitFile(filePath);
Response.Flush();
//Response.End();
}
catch(exception e)
{
}
}
}
------------------
In ASCX page
<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Download" HeaderText="AVAILABLE FILES"
Text="Download" UniqueName="FILEPATH">
</telerik:GridButtonColumn>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Submit">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Note: The submit button is inside asp:updatePanel.