Solved

Downloading files

Posted on 2012-12-23
1
299 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

13 Experts available now in Live!

Get 1:1 Help Now