MacD Level: Big Cheese
 Registered: 06-01-2004 Posts: 19
|
Downloading problem
Hi ladies and gentlemen,
I have got a code written in ASP.NET which is dowloading a text file(*.txt) that i would have generated. The problem i am having is when i download it, it will be containg HTML tags of the page where dowloading is taking place.
I do not have this problems when i am downloading an Excel file.
My code which is in my code-behind file is as follows:
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "Attachment; Filename=" & filen)
Response.Flush()
Response.WriteFile(filepathandname)
Your help is greatly appreciated.
Regards,
____________________________
MacD
|