Downloading files

Mazzarino
Mazzarino used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You have not initialized variable response. Instead of Nothing it shoud be initialized with HttpContext.Current.Response.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial