Hi,
I had about the same problem, but in my case, users can download any kind
of file.
This is the way I did it: (and it works)
Response.ContentType = "";
Response.AddHeader("content-disposition","attachment; filename=" +
strRealFileName);
Response.WriteFile(fn);
Where fn contains the name of the file on the server, and strRealFileName
is the name suggested in the download dialog.
Bart Vanwesemael
bva@E...
> Hello
>
> In asp i used this to force dowload-popup, but why doesn=B4t it work in
> aspx??
>
>
> <script language=3D"C#" runat=3D"Server">
> void Page_Load(object sender, EventArgs e) {
> Response.Addheader("Content-Disposition", "attachment;
> filename=3Dtest.csv")
> Response.ContentType =3D"text/csv";
> Response.Write("1,test,45");
> }
> </script>
>
> Daniel
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>