Re: Page Load event is called....

From: MooreSmnith (MSmith1990_at_hotmail.com)
Date: 07/07/04


Date: Tue, 6 Jul 2004 19:24:31 -0700

My question is when the response.Redirect is executed, page_load event of
the page(Page 1) which has Response.Redirect and the Redirected(Page 2) page
Page_load event is getting called. I am not understanding why the the
Page_Load event of Page 1 is called. Calling Page 2 Page_Load evevnt is
understandable.
Thanks for your answers and helping me to understand this flow.
Moore.

"EijiTek" <eijitek@comcast.net> wrote in message
news:vqednZX0KY1kxnbdRVn-vg@comcast.com...
> Every ASP.NET page is an instance of a class and therefore each page has
its
> own life cycle. Each page has a Page_Load event that is called as part of
> the life cycle of every page, not just on post back. If you want certain
> code to only run when a postback occurs you can test for it with
> Page.IsPostBack.
>
> Response.Redirect results in a response being sent to the client,
> instructing it (the client) to open a different page instead of the one
> originally requested. Server.Transfer on the other hand occurs on the
> server and skips the additional HTTP request but neither method will
supress
> the call to the Page_Load event handler on the next page.
>
> "MooreSmnith" <MSmith1990@hotmail.com> wrote in message
> news:eJppsS7YEHA.3512@TK2MSFTNGP12.phx.gbl...
> > When I navigate to the next page using
> > Response.Rediect("MyNextPage.aspx") current page Page_Load event is
> called.
> > What I may wrongly understood is that post back will happen whenever
there
> > is any server side event happens, resulting in Page_load event.
Page_Load
> is
> > also happening when I navigate to the next page. That means Page_load
will
> > always happen when I navigate to the next page. Please correct me If I
> have
> > totally misunderstood this concepts.
> > Moore Smith
> >
> >
> >
> >
> >
>
>



Relevant Pages

  • Re: Page Load event is called....
    ... the life cycle of every page, ... Response.Redirect results in a response being sent to the client, ... server and skips the additional HTTP request but neither method will supress ... > also happening when I navigate to the next page. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Visitor, dynamic_cast or ...
    ... >>This yields a fairly simple and efficient view of the tree that doesn't ... >>concerns of tree navigation from leaf processing (i.e., ... the client knows what type it will have in hand prior to actually ... OcTree to navigate to either specialization directly; ...
    (comp.object)
  • Re: Downcasting - whats the problem?
    ... > Responding to Developer... ... >> I would like to ask what will be a very basic question for many on ... there is no to/from to navigate. ... > However, if a Client must access the doAresponsibility, it can't do ...
    (comp.object)
  • Re: Downcasting - whats the problem?
    ... > I would like to understand what the real problem is with downcasting ... there is no to/from to navigate. ... That is, Client ... However, if a Client must access the doAresponsibility, it can't do ...
    (comp.object)
  • After Navigate() webbrowser properties are invalid
    ... I have a VC++ project that at some point must POST an HTTP request to ... I am using IWebBrowser Navigate() ... function to POST an HTTP request to a server. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)