File download issues

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have seen other messages about this so I am asking something that is in
addition to those answers. I have been able to get a file dialog to come up
and for me to download files but it downloads the text file with the webpage
appended to the end, is that b/c I didnt put response.end after the
information was added?

Also - this is really an access issue but it is only happeneing in this
situation - I am able to write the textfile out but when I go to download it
- it suddenly started giving me an UnauthorizedAccessException - saying
"Access to path "c:\" is denied". I am using C: as a development location
but it worked fine up until about 45 minutes ago.

Thanks,
Cleako
 
I have seen other messages about this so I am asking something that is
in addition to those answers. I have been able to get a file dialog
to come up and for me to download files but it downloads the text file
with the webpage appended to the end, is that b/c I didnt put
response.end after the information was added?

Hi Cleako,

The reason the HTML code is being appended is because the page continues
the rest of its lifecycle after you do the postback that triggers the download.
I've found that Response.End causes some problems in ASP.NET (http://support.microsoft.com/kb/312629/EN-US/).
Setting Response.SuppressContent = true after the download has always worked
for me.

Best,
Chri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top