AspContext

The AspContext is the object that you use to access the objects in your component's context. You retrieve one of the objects in the context, such as Response, Request, ObjectContext, Session, Application, or Server, by calling the get method that corresponds to the object that you want to retrieve. Since all of the member functions are static, you do not need to actually to create an instance of AspContext.

Since an object's context is only guaranteed valid for a single HTTP request, you should get a fresh reference to an object in your context in each method call.

public class AspContext
{
    public static Request getRequest();
    public static Response getResponse();
    public static Server getServer();
    public static Session getSession();
    public static Application getApplication();
    public static IObjectContext getObjectContext();
}


AspContext Members

public static Request getRequest( );

Returns a reference to the current Request object.

public static Response getResponse( );

Returns a reference to the current Response object.

public static Server getServer( );

Returns a reference to the current Server object.

public static Session getSession( );

Returns a reference to the current Session object.

public static Application getApplication( );

Returns a reference to the current Application object.

public static IObjectContext getObjectContext( );

Returns a reference to the current IObjectContext, which can be used by your component if it supports transactions. For more information on IObjectContext, see the Microsoft Transaction Server documentation.