Exactly what I needed Steve. Thanks Dude.
"Steve C. Orr [MVP, MCSD]" <Steve@Orr.net> wrote in message
news:#7PV2FmzDHA.1744@TK2MSFTNGP12.phx.gbl...
> To go along with Carl's answer, you can use the Response.Writefile method.
> Something like this should work:
>
> Response.Clear();
> Response.ContentType = "application/vnd.ms-excel"
>
Response.AddHeader("Content-Disposition","attachment;filename=myfile.xls");
> Response.WriteFile("myfile.xls");
>
> Here's more info:
>
>
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
>
http://Steve.Orr.net > Hire top-notch developers at
http://www.able-consulting.com >
>
>
> "Ali" <elhamdiali@hotmail.com> wrote in message
> news:OqiGF$lzDHA.2156@TK2MSFTNGP09.phx.gbl...
> > Thanks Carl and I am sorry for cross posting. I just did not know any
> > better.
> >
> > Your response assumes that I need to create an excel file using ASP.NET.
> > The problem is that I already have the Excel file on the server. All I
> want
> > to do is download it. But not using the anchor nor the hyperlink tags.
> >
> > Ali
> >
>
http://support.microsoft.com/default.aspx?scid=kb;en-us;318756&Product=aspne > > t
> >
> >
> > "Carl Prothman [MVP]" <carlpr@spamcop.net> wrote in message
> > news:#9wqJslzDHA.3196@TK2MSFTNGP11.phx.gbl...
> > > Ali wrote:
> > > > I need a functionality where my clients download Excel files and
> > > > after they do, I do some processing. Downloading is easily achieved
> > > > using a anchor or hyperlink tag, but that does not give me the full
> > > > functionality I am after. So, I came up with a way to download the
> > > > files using a stream but after I download the file and try to open
it
> > > > in Excel I get garbage.
> > > >
> > > > Response.AddHeader("Content-Disposition", "attachment; filename=" &
> > > >
> > >
> > > Ali,
> > > You are missing the ContentType setting.
> > > Response.ContentType = "application/vnd.ms-excel"
> > >
> >
>
http://support.microsoft.com/default.aspx?scid=kb;en-us;318756&Product=aspne > > t
> > >
> > > Also, please don't cross-post to so many newsgroups.
> > >
> > > --
> > >
> > > Thanks,
> > > Carl Prothman
> > > Microsoft ASP.NET MVP
> > >
> > >
> >
> >
>
>