IamDeveloper
IamDeveloper

Reputation: 5226

Page.Request behaviour

I have a page and few controls. I'm doing a normal postback.

On InitializeCulture event of the page the Page.Request object contains e.g. controls with their values - and that's great.

But on the other hand, when I'm trying to access this collection on the Page_Load or OnInit events, it's way smaller and doesn't have any of the controls that have been there before.

Can anyone tell me what happens with Page.Request between these events?

EDIT:
Thanks guys, I was aware of the Page Life cycle term:) and these links were indeed helpful. I probably haven't pointed that out clearly , but:

So the question is what and when happens with Page.Request between InitializeCulture() and next events that makes it smaller?
Btw. I find http://i.msdn.microsoft.com/dynimg/IC386473.png a much better illustration of Page Life Cycle.

EDIT: What a mistake. Someone was doing a redirect which was resetting the whole Request collection... Lame of me. I would delete this post, but cannot.

Upvotes: 1

Views: 837

Answers (1)

Pranay Rana
Pranay Rana

Reputation: 176886

Basic page life cycle will answer your question Full article: http://www.codeproject.com/KB/aspnet/ASPDOTNETPageLifecycle.aspx

ASP.NET Life cycle
(source: codeproject.com)

Image Source: ASP.NET application and page life cycle, by Shivprasad Koirala, 19 April 2010

Upvotes: 1

Related Questions