RadControls for ASP.NET AJAX If you want to invoke download for a file from ajaxified control (either placed in RadAjaxPanel or ajaxified by RadAjaxManager), you cannot use the normal
CopyC#
Response.WriteFile("~/Your_File");
CopyVB.NET
Response.WriteFile("~/Your_File")because the xmlhttp request cannot handle this.
Instead you can use the ResponseScripts collection of the RadAjax controls to change the location header and download the file:
CopyC#
RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", "http://yoursite.com/Your_File"));
CopyVB.NET
RadAjaxPanel1.ResponseScripts.Add(String.Format("window.location.href = ""{0}"";", "http://yoursite.com/Your_File"))The ResponseScripts collection will be executed after ajax request completes.