Since you are using Server, I suspect the class needs to be passed the
Httpcontext.
"The HttpContext.Server property provides programmatic access to the
properties and methods of the HttpServerUtility class. Because ASP.NET pages
contain a default reference to the System.Web namespace (which contains the
HttpContext class), you can reference the members of HttpContext on an .aspx
page without the fully qualified class reference to HttpContext. For
example, you can use just Server.CreateObject("MyCOMComponent") to create an
instance of a COM object on the server. If you want to use the members of
HttpServerUtility from an ASP.NET code-behind module, however, you must
include a reference to the System.Web namespace in the module and also fully
qualify the reference to the currently active request/response context and
the class in System.Web you want to use. For example, in a code-behind page
you must specify the full name
HttpContext.Current.Server.CreateObject("MyCOMComponent"). "
http://msdn.microsoft.com/library/d...frlrfsystemwebhttpcontextclassservertopic.asp