i am experiencing a problem while downloading files through rad controls
okai i have a button that is called generate presentation , the button is inside rad ajax panel , so when the button is pressed an asynchronous post back goes to server and the uploading panel becomes visible . on server i use the following code to transmit the file to the user who can then download it
string fileNameToDisplay = TrimNonCompliantStrings();
string virtualPath = @"~\" + newPresentationDoc.Replace(HttpContext.Current.Request.PhysicalApplicationPath, String.Empty);
// Response.End();
RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", virtualPath));
but nothing really happens when the response is sent from the server it just closes the update panel and no download dialog is shown previously before ajaxifying i was using the following appraoch , and it was working fine
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" +fileNameToDisplay ); //+ ".pptx"
Response.AppendHeader("Content-Disposition", "attachment;filename=" + "babe" + ".pptx");
Response.TransmitFile(virtualPath);
Response.End();
i know a workaround where i can disable ajax request by replacing it with a full blown request to download the file , but by that i l loose the upload panels preloader .... , How can i resolve this issue
here is the markup
<telerik:AjaxSetting AjaxControlID="btn_Generate">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnPublish">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
okai i have a button that is called generate presentation , the button is inside rad ajax panel , so when the button is pressed an asynchronous post back goes to server and the uploading panel becomes visible . on server i use the following code to transmit the file to the user who can then download it
string fileNameToDisplay = TrimNonCompliantStrings();
string virtualPath = @"~\" + newPresentationDoc.Replace(HttpContext.Current.Request.PhysicalApplicationPath, String.Empty);
// Response.End();
RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", virtualPath));
but nothing really happens when the response is sent from the server it just closes the update panel and no download dialog is shown previously before ajaxifying i was using the following appraoch , and it was working fine
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" +fileNameToDisplay ); //+ ".pptx"
Response.AppendHeader("Content-Disposition", "attachment;filename=" + "babe" + ".pptx");
Response.TransmitFile(virtualPath);
Response.End();
i know a workaround where i can disable ajax request by replacing it with a full blown request to download the file , but by that i l loose the upload panels preloader .... , How can i resolve this issue
here is the markup
<telerik:AjaxSetting AjaxControlID="btn_Generate">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnPublish">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>