Click here to Skip to main content
15,905,913 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Remittance.Common;
using Remittance.DAL.Entities;
using Remittance.DAL.Repo;
using Remittance.DAL;

namespace Remittance.Payment
{
    public partial class download : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           IQueryable<transaction> src=  Session["SRC"]as IQueryable<transaction>;
            string reportName = (string)Session["reportname"];
            string extension = (string)Session["extension"];
           byte[] bytes = (byte[])Session["Byte"];
            Response.Clear();
           // Response.ContentType = mimeType;
            Session["Success"] = "Success"; 
            Response.AddHeader("Content-Disposition", "attachment; filename=" + reportName + "." + extension);
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.OutputStream.Write(bytes, 0, bytes.Length);
            Response.Flush();
            Response.End();
           
        }
    }
}
</transaction></transaction>



I use this for download a file in asp.net, its work in Mozilla, google chrome, IE9
but don't work in IE6,7,8?? why
please answer me if any of u know ?
Thanks for reading.

[Edited]Code is wrapped in "pre"[/Edited]
Posted
Updated 30-May-11 1:12am
v2
Comments
Ashishmau 30-May-11 7:21am    
what error ur getting while downloading
raseldc 30-May-11 7:31am    
there are no error showing . but nor work :(
Monjurul Habib 30-May-11 18:00pm    
where is your Response.ContentType = ???
raseldc 31-May-11 6:18am    
use Response.ContentType = "application/pdf"
but problem not solved

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900