this.Page和(页)HttpContext.Current.Handler之间的不同 [英] different between this.Page and (Page)HttpContext.Current.Handler

查看:397
本文介绍了this.Page和(页)HttpContext.Current.Handler之间的不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI!

有谁知道之间不同的 this.Page (页)HttpContext.Current.Handler

does anybody know about different between this.Page and (Page)HttpContext.Current.Handler?

我有这样的 this.page 返回null一个问题,有人写信给我说用结构的(页)HttpContext.Current.Handler会更好。

i had a problem that this.page returned null, and someone wrote me that using the construct "(Page)HttpContext.Current.Handler" will be better.


  1. 有什么不同?

  2. 为什么以及何时 this.page 返回NULL?

  1. what the different?
  2. why and when this.page return null?

谢谢!

沙尼

推荐答案

this.Page 将通过搜索它的父层次找到一个控件的页面。

this.Page will find a control's Page by searching it's parent hierarchy.

HttypContext.Current.Handler 将通过查看当前上下文(线程)找到该页面。

HttypContext.Current.Handler will find the page by looking at the current context (thread).

第将为空,即使如果控制尚未投入页面层次结构还没有第二个是有效的。

The first will be null even when the second is valid if the control hasn't been put into the page hierarchy yet.

这篇关于this.Page和(页)HttpContext.Current.Handler之间的不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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