Response.ContentType="application/xls";
Response.WriteFile("Excel文件名",true);

解决方案 »

  1.   

    有可能给分太少啦,没人给你回答。用上面写的方法,就把Excel文件直接打开在客户端的页面上,其实也就写到本地的临时文件里。
    Response.ContentType="application/xls";
             Response.Redirect("Excel文件名");
    也可以。
      

  2.   

    Response.Clear();
    Response.AddHeader("Content-Disposition", "attachment; filename=export.xls");
    Response.ContentType = "application/x-unknown";
    Response.WriteFile(path);
    Response.End();