I download files usually from somewhere like Page21.aspx.vb and I use the code given in the attached snippet.
targetname is sergyu-Screed.pdf
I am trying to run this from ClassC which is in App_Code and it's not working.
It is giving an error message saying "object variable not set".
Since moving code to App_code I seem to have problems with "response" and "cache"; they seem more often to throw up errors which I can sometimes resolve and sometimes not. These did not give problems when they were on regular pages like .aspx.vb.
Writing System.Web.HttpContext.response does not work. DownLd.txt