A
ajholme
We have a problem in our application: if a user clicks a link to load
another page before the previous ASPX has finished executing, the Sub
New() constructor of the second page executes immediately, but its
Page_Load() event is not fired until the previous ASPX has finished.
I've reproduce this outside our applciation using two almost identical
pages Test1.aspx and Test2.aspx as follows:
----------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Test1.aspx.vb" Debug="False" Trace="False"
Inherits="UserInterface.Web.CTest1" %>
<html>
<head></head>
<body>
<h1>Test1</h1>
Before ... <%Snooze()%> After
</body>
</html>
----------------------------------------------------------
Public Class CTest1
Inherits System.Web.UI.Page
Public Sub New()
System.Diagnostics.Debug.WriteLine("Test1 New")
End Sub
Public Overridable Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
System.Diagnostics.Debug.WriteLine("Test1 Page_Load")
end sub
Public Sub Snooze()
System.Diagnostics.Debug.WriteLine("Test1 Snooze --->")
System.Threading.Thread.Sleep(10000)
System.Diagnostics.Debug.WriteLine("Test1 Snooze <---")
End Sub
End Class
another page before the previous ASPX has finished executing, the Sub
New() constructor of the second page executes immediately, but its
Page_Load() event is not fired until the previous ASPX has finished.
I've reproduce this outside our applciation using two almost identical
pages Test1.aspx and Test2.aspx as follows:
----------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Test1.aspx.vb" Debug="False" Trace="False"
Inherits="UserInterface.Web.CTest1" %>
<html>
<head></head>
<body>
<h1>Test1</h1>
Before ... <%Snooze()%> After
</body>
</html>
----------------------------------------------------------
Public Class CTest1
Inherits System.Web.UI.Page
Public Sub New()
System.Diagnostics.Debug.WriteLine("Test1 New")
End Sub
Public Overridable Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
System.Diagnostics.Debug.WriteLine("Test1 Page_Load")
end sub
Public Sub Snooze()
System.Diagnostics.Debug.WriteLine("Test1 Snooze --->")
System.Threading.Thread.Sleep(10000)
System.Diagnostics.Debug.WriteLine("Test1 Snooze <---")
End Sub
End Class