Re: Page Load event is called....
From: MooreSmnith (MSmith1990_at_hotmail.com)
Date: 07/07/04
- Next message: Carlos: "how to get asp .net 2.0"
- Previous message: Martin Feuersteiner: "Problem with HTA streaming data to client"
- In reply to: EijiTek: "Re: Page Load event is called...."
- Next in thread: EijiTek: "Re: Page Load event is called...."
- Reply: EijiTek: "Re: Page Load event is called...."
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
> >
> >
> >
>
>
- Next message: Carlos: "how to get asp .net 2.0"
- Previous message: Martin Feuersteiner: "Problem with HTA streaming data to client"
- In reply to: EijiTek: "Re: Page Load event is called...."
- Next in thread: EijiTek: "Re: Page Load event is called...."
- Reply: EijiTek: "Re: Page Load event is called...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|