Solved

Downloading files

Posted on 2012-12-23
1
296 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 500 total points
ID: 38717535
You have not initialized variable response. Instead of Nothing it shoud be initialized with HttpContext.Current.Response.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now