Hi,
IIRC the Page_Load is added in the OnInit handler:
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"z. f." <> wrote in message
news:...
> also
>
> from the IL created by VB compiler you see that in the constructor it is
> adding the event handler:
>
> Public Sub New()
> AddHandler MyBase.Load, New EventHandler(AddressOf Me.Page_Load)
> End Sub
>
>
>
>
>
> "Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
> message news:...
> > Please don't cross-post.
> >
> > I'm assuming you are using C# 'cuz you wouldn't have this behaviour in
> > VB....anyways, the simplest solution is to go into your derived page's
> > OnInit function in the "Web Form Designer generated code" region, and
> change
> > the order of the two executions:
> >
> > InitializeComponent();
> > base.OnInit(e);
> >
> > to
> >
> > base.OnInit(e);
> > InitializeComponent();
> >
> > This will cause the base page's init to load first, which will cause
it's
> > Load event to get hooked up first, thus causing it to fire first.
> >
> > Karl
> >
> > "z. f." <> wrote in message
> > news:%...
> > > Hi,
> > >
> > > i have a class that is derived from System.Web.UI.Page, and this is
the
> > > class i use in my application as PageBase.
> > > all other page classes are deriverd from my PageBase instead of the
> > original
> > > System.Web.UI.Page in order to have common checks in the page base.
> > >
> > > i make securirty checks in the page base page_load event.
> > > if the security fails, i can do whatever i want before the "real" /
> > derived
> > > page gets to be executed.
> > >
> > > but i have noticed that the derived page load event gets to be called
> > before
> > > the base page load event.
> > >
> > > so i have a problem.
> > >
> > > i can cancel the use of page_load in my derived pages, but i use this
> > > function to check on PostBack events that does not have server (like
> > button)
> > > event handler, but there when will i move it to?
> > >
> > > is this the correct execution order - the derived gets to called
before
> > the
> > > base?
> > >
> > > is this also the order of execution in inheritence or only with
> delegated
> > > event handlers? ( i mean when you use the syntax of Page.onLoad +=
> > > this_onLoad )....
> > >
> > > TIA, z.
> > >
> > >
> >
> >
>
>
|