ページクラスはクラスから派生しTemplateControlます。
public class Page : TemplateControl, IHttpHandler
TemplateControlクラスは抽象クラスから派生しますControl。
public abstract class TemplateControl : Control, ...
ControlクラスがPage派生するクラスには、Pageという名前の仮想プロパティがあります。
// Summary:
// Gets a reference to the System.Web.UI.Page instance that contains the server
// control.
//
public virtual Page Page { get; set; }
Pageクラスには、などのプロパティがありますIsPostBack。IsValid
// Summary:
// Gets a value that indicates whether the page is being rendered for the first
// time or is being loaded in response to a postback.
//
public bool IsPostBack { get; }
したがって、
aspxページはクラスから派生しているため、Pageクラスも継承TemplateControlしControlます。クラスには、クラスのプロパティにアクセスできるようにControlという名前のパブリックプロパティがあります。また、クラスにはなどのパブリックプロパティがあるため、プロパティからこれらのプロパティを使用できます。PagePagePageIsPostbackIsValidPage
public class Test : Page
{
public Test()
{
bool test = this.IsCallback;
}
}