Passing Context
Today I redesigned an ASP.NET app that outputs to Excel, placing the codebehind in a separate project namespace. All was well as a UserControl with codebehind in the same directory, but I got hit with Object reference not set to an instance of an object for the Response object.
This Alvin Bruney newsgroup response gave me the clue I needed to pass HttpContext.Current to the class. Actually, I didn't have to “pass” anything, just prefixed my Response.Writes with HttpContext.Current, which did the trick.