views:

38

answers:

2

Im unable to access server/response variable in my static function. Can i access them in static function or should i include some namespaces

A: 

System.Web.HttpContext.Current object includes current Server, Response, Request etc instances.

Musa Hafalır
+2  A: 

I'm having a really hard time understanding your question, but is it possible that you are looking for HttpContext.Current?

var context = HttpContext.Current;
// now you can use context.Request, context.Response, context.Server, etc.
Heinzi