PRB: ASP Does Not Support Events (243546)



The information in this article applies to:

  • Microsoft Active Server Pages

This article was previously published under Q243546

SYMPTOMS

Active Server Pages (ASP) does not support events.

CAUSE

ASP does not have support to handle events. ASP as an automation client is late-bound and does not have access to the type information required to determine if the object has implemented the IConnectiontPoint interface neccessary for events.

RESOLUTION

Call a COM object from ASP that in turn calls the component that raises the event. The following logic represents the implementation:
  1. ASP page calls component 1.
  2. Component 1 calls component 2, which performs some work and then raises an event.
  3. Component 1 loops until a flag is set. The flag is triggered by component 2 raising the event.
  4. Component 2 raises an event to notify component 1 that it has completed.
  5. Component 1 returns to ASP.
In general, because ASP should process requests as fast as possible and return immediately to the client, you should not call components that are waiting on event notifications from other components. If you need to call components that wait for event notification, consider using Microsoft Message Queue (MSMQ) so that you can immediately return control to your ASP page.

MORE INFORMATION

The following references provide information on using MSMQ:

Modification Type:MinorLast Reviewed:4/22/2003
Keywords:kbEventService kbprb KB243546