ASPContext Class

You can use the AspContext object 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. Because all the member functions are static, you do not need to actually to create an instance of AspContext.

Because an object's context is only guaranteed to be 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 in the MSDN™ Library.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.