Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Downloading files

Posted on 2012-12-23
1
Medium Priority
?
309 Views
Last Modified: 2012-12-25
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
0
Comment
Question by:Mazzarino
1 Comment
 
LVL 8

Accepted Solution

by:
JustAndrei earned 1500 total points
ID: 38717535
You have not initialized variable response. Instead of Nothing it shoud be initialized with HttpContext.Current.Response.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question