RadAjax for ASP.NET

Download files with ajaxified control Send comments on this topic.
How-to > Download files with ajaxified control

Glossary Item Box

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

C# Copy Code
Response.WriteFile("~/Your_File");
because the xmlhttp request cannot handle this.

Instead you can use the ResponseScripts collection of the ajax control to change the location header and download the file:

Example Title Copy Code
RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", http://yoursite.com/Your_File));
The ResponseScripts collection will be executed after ajax request completes.