Re: To really understand the Page_Load event
From: Studio P.M. (StudioPM_at_discussions.microsoft.com)
Date: 03/02/05
- Next message: Joanna Carter \(TeamB\): "Re: Bussines objects"
- Previous message: Peter Jausovec: "Re: add button in form"
- In reply to: Ollie Riches: "Re: To really understand the Page_Load event"
- Next in thread: Ollie Riches: "Re: To really understand the Page_Load event"
- Reply: Ollie Riches: "Re: To really understand the Page_Load event"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 2 Mar 2005 03:35:02 -0800
Thanks for your suggestion.
Anyhow, may I?:
Here too this paper is talking about the “phases in the lifecycle of a
control.” But I’m concerned with an .aspx page, not with a control possibly
contained in such a page. And I’m not at all convinced that it is the same
thing, or it is equivalent.
See you.
P.M.
"Ollie Riches" wrote:
> this might help you
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> l/cpconControlExecutionLifecycle.asp
>
>
> --
> HTH
>
> Ollie Riches
> http://www.phoneanalyser.net
>
> Disclaimer: Opinions expressed in this forum are my own, and not
> representative of my employer.
> I do not answer questions on behalf of my employer. I'm just a programmer
> helping programmers.
>
> "Studio P.M." <StudioPM@discussions.microsoft.com> wrote in message
> news:D8452666-3B77-4F78-A942-8891A02661C0@microsoft.com...
> > Dear colleagues,
> > I kindly ask the C# developers community to help me to REALLY
> understand
> > the Page_Load event, so to REALLY have it under control.
> >
> > Reason for this question is that I cannot anymore accept passively the
> > behavior of the "Web Form Designer" automatically generated code because
> of
> > the fact that, in some circumstances (that I can reproduce at will), my
> code
> > is victim of a Page_Load multiple "firing". In other words the Page_Load
> > event handler inexplicably enters more than once and, at the second entry,
> > Login credentials are asked again interactively. With disruptive effects
> for
> > my current project.
> >
> > Let me begin this discussion with what I certainly do not know, or I do
> not
> > know for sure.
> >
> >
> > P1) I do not know what really triggers the OnInit event, beyond the fact
> > that it is overridden in the "Web Form Designer" automatically generated
> code
> > (see hereafter).
> >
> >
> > P2) I do not know what really the original base.OnInit(e) at last will
> do.
> > Indeed I've found documentation only about Control.OnInit, but I'm not
> > convinced it can apply to this case, where no server control in involved
> > (please see next point), and such an article, as the "ASP.NET Server
> Control
> > Event Model", doesn't exactly apply. Does it?
> >
> >
> > P3) Consider that, by definition, "events associated with server controls
> > are raised on the client but handled on the Web server by the ASP.NET page
> > framework". Here the case of OnInit, of an .aspx Web page, is rather
> > different, isn't it? Indeed the OnInit event happens BEFORE the presence
> of
> > the Web page on the client computer, indeed this is the very event of
> posting
> > a page from the server to the client. And this event shouldn't happen
> again
> > until I deliberately ask for another .aspx page. Shouldn't it? But, alas,
> it
> > DOES happen, out of my control. And all that is precisely the reason of
> this
> > call "To really understand the Page_Load event".
> >
> > As you see I'm really confused (and baffled too.).
> > Thanks for your time.
> > P.M.
> >
> > - - - - -=- - - - -=- - - - -=
> > "Web Form Designer" automatically generated code:
> >
> > #region Web Form Designer generated code
> > override protected void OnInit(aS.EventArgs e) {
> > //
> > // CODEGEN: This call is required by the ASP.NET Web Form Designer.
> > //
> > InitializeComponent();
> > base.OnInit(e);
> > }
> >
> > /// <summary>
> > /// Required method for Designer support - do not modify
> > /// the contents of this method with the code editor.
> > /// </summary>
> >
> > private void InitializeComponent() {
> > this.Load += new System.EventHandler(this.Page_Load);
> > }
> > #endregion
> >
>
>
>
- Next message: Joanna Carter \(TeamB\): "Re: Bussines objects"
- Previous message: Peter Jausovec: "Re: add button in form"
- In reply to: Ollie Riches: "Re: To really understand the Page_Load event"
- Next in thread: Ollie Riches: "Re: To really understand the Page_Load event"
- Reply: Ollie Riches: "Re: To really understand the Page_Load event"
- Messages sorted by: [ date ] [ thread ]