Page.Request行为 [英] Page.Request behaviour

查看:168
本文介绍了Page.Request行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,几个控件。我在做一个正常的回发。

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

在页面InitializeCulture事件Page.Request对象包含例如与他们的价值观控制 - 这就是伟大的。

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

但在另一方面,当我试图访问在Page_Load或OnInit的事件在此集合,它的方式小,没有任何一直在那里之前的控件。

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.

谁能告诉我用什么Page.Request这些事件之间发生了什么?

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

编辑:结果
谢谢你们,我知道了页面生命周期期限:)而这些链接的确很有帮助。
我可能没有指出了这一点清楚了,但是:


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:


  • 为InitializeCulture覆盖方法()我Page.Request充满了各种控制内。调用base.InitializeCulture()之后,Page.Request只有服务器变量。我可以看看这里我的控制值,但不能做到这一点 - 这些控件尚未初始化(因此调用Request.Params.Get(SomeControl1.UniqueID)抛出错误)

  • 覆盖preINIT,init或Page_Load中没有帮助的。

所以,问题是什么时候与Page.Request InitializeCulture()和下一事件之间发生,使得它更小?结果
顺便说一句。我觉得 http://i.msdn.microsoft.com/dynimg/IC386473.png一个更好的例证页生命周期的。

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.

编辑:
什么是错误的。有人在做一个重定向这是重新设置整个Request集合...拉梅我。我会删除这篇文章,但不能。

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.

推荐答案

基本页面生命周期将会回答你的问题
文章全文:
HTTP://www.$c$cproject.com/KB/ ASPNET / ASPDOTNETPageLifecycle.aspx

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

这篇关于Page.Request行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆