Re: Page Load event is called....
From: EijiTek (eijitek_at_comcast.net)
Date: 07/07/04
- Next message: Steven Cheng[MSFT]: "Re: picture in data grid based on value"
- Previous message: Bobby: "problem with ASP.NET Validator Control in 2 Form"
- In reply to: MooreSmnith: "Re: Page Load event is called...."
- Next in thread: MooreSmnith: "Re: Page Load event is called...."
- Reply: MooreSmnith: "Re: Page Load event is called...."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Jul 2004 21:40:37 -0500
As I mentioned, each page has a life cycle therefore, requesting a page
starts the life cycle. In order to perform a redirect you have to be
executing code from the first page.
Where in Page1 are you making the call to Response.Redirect()?
"MooreSmnith" <MSmith1990@hotmail.com> wrote in message
news:eh1zKm8YEHA.2944@TK2MSFTNGP11.phx.gbl...
> 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: Steven Cheng[MSFT]: "Re: picture in data grid based on value"
- Previous message: Bobby: "problem with ASP.NET Validator Control in 2 Form"
- In reply to: MooreSmnith: "Re: Page Load event is called...."
- Next in thread: MooreSmnith: "Re: Page Load event is called...."
- Reply: MooreSmnith: "Re: Page Load event is called...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|