Posted on: 9/10/2013 2:06:02 PM | Views : 644

Hi all,
I have question about download file in asp.net.
in asp.net mvc, it's so easy with action return Fileresult
public FileResult GetExcel() { //declaration (url,login,password) try { HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url); HttpWebResponse response; var myCredentials = new NetworkCredential(login,password); request.Credentials = myCredentials ; try { // lancement de la requête HTTP response = (HttpWebResponse)request.GetResponse(); } catch (WebException wex) { return null; } var data = response.GetResponseStream(); return File(data, "application/vnd.ms-excel"); } I try to do the same thing in  asp.net , I try to use webmethod  with ajax method
public static object GetExcel() { //declaration (url,login,password ...

Go to the complete details ...