Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 28th, 2003, 09:54 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default PhilePage execution order

Hi all,

Just wondering, on my first request to a protected page, whereby the login screen comes up, i see the following order of events

aspx.page Begin Init
 In Derived OnInit 0.000697 0.000697
 In SitePage OnInit 0.001714 0.001017
aspx.page End Init 0.002163 0.000449
 In Derived PageLoad 0.002942 0.000779
 In SitePage PageLoad 0.004038 0.001096
 In Derived PageLoad 0.004109 0.000071
aspx.page Begin PreRender 0.004157 0.000048

Instead of the expected:

Derived OnInit -> PhilePage OnInit -> PhilePage PageLoad -> Derived PageLoad

I believe my event handlers are being wired in the proper order in the derived page:


Protected Overrides Sub OnInit(ByVal e As EventArgs)
         Trace.Warn("In Derived OnInit")
         MyBase.OnInit(e)
         InitializeComponent()
      End Sub


      'This call is required by the Web Form Designer.
      <System.Diagnostics.DebuggerStepThrough()> _
      Private Sub InitializeComponent()
         AddHandler Me.Load, AddressOf Page_Load
      End Sub

After this first request, everything runs as expected. Anyone else encountering a similar situation?

Jake
 
Old August 28th, 2003, 10:29 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello again....acually, the execution order is not as expected on other pages as well b/c when the user tries to access a protected page, thier Principal is not loaded b/c the PhilePage PageLoad event hasn't fired yet! It is doing the same thing as before:

Derived OnInit -> PhilePage OnInit -> Derived PageLoad -> PhilePage PageLoad -> Derived PageLoad

please help!

 
Old August 28th, 2003, 11:56 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All,

I think I have discovered the reason for this madness. If we follow the reccomendation of having this code in our derived pages:

'This call is required by the Web Form Designer.
      <System.Diagnostics.DebuggerStepThrough()> _
      Private Sub InitializeComponent()
         AddHandler Me.Load, AddressOf Page_Load
      End Sub

Then be sure to removed the 'handles MyBase.Load' from your Page_Load methods...which the designer automatically creates for you when you create a new web form. I am sure a similar fix exists for the C# version.

Jake






Similar Threads
Thread Thread Starter Forum Replies Last Post
Execution B.V.Madhav Crystal Reports 0 May 9th, 2005 04:50 AM
PhilePage Class on p. 58 JeffSpitzer BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 8th, 2004 09:08 AM
PhilePage Session ? jfreise BOOK: ASP.NET Website Programming Problem-Design-Solution 0 August 20th, 2003 10:31 AM
PhilePage.cs Page_Load event betulus BOOK: ASP.NET Website Programming Problem-Design-Solution 2 June 10th, 2003 02:46 AM
document node order vs sort node order. ladyslipper98201 XSLT 2 June 5th, 2003 11:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.