开发者

When does OnEndPage method run for object created indirectly by ASP (classic) page

I'm trying to debug an issue which may be due to a delay in running some cleaup code that's in an OnEndPage method.

I have a LoginPage class (in VB6) which is normally created directly by an ASP page. But in another case, an ASP page creates another VB object, which then does approximately this

Set oLoginPage = Server.CreateObject("LoginPage")
Call oLoginPage.DoLogout;
Set oLoginPage = Nothing

Some crucial cleanup is done in the OnEndPage method of LoginPage class, and it looks like this happens asynchronously, and with enough of a lag to cause problems.

Can anyone confirm that OnEndPage runs asynchronously, and开发者_高级运维 might lag a bit? I've not been able to find any mention of this in documentation, just that objects are garbage collected "as soon as the reference count goes to zero." But that doesn't seem to be what's happening in my code.

This is a VB6 application called by an ASP page. It needs to run on multiple versions of IIS from 5.0 upwards.

Thanks.


O.K., it's simpler than I thought. Apparently the OnEndPage method is run by ASP after all the rest of the stuff on the page is finished. This applies even to VB objects created indirectly (that is, created by VB objects that were created by the ASP page), as long as they are created using Server.CreateObject().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜