Gets a reference to the Page instance that contains the server control.
Assembly: System.Web (in System.Web.dll)
Syntax
<BindableAttribute(False)> _
<BrowsableAttribute(False)> _
Public Overridable Property Page As Page
Get
Set[BindableAttribute(false)]
[BrowsableAttribute(false)]
public virtual Page Page { get; set; }[BindableAttribute(false)]
[BrowsableAttribute(false)]
public:
virtual property Page^ Page {
Page^ get ();
void set (Page^ value);
}[<BindableAttribute(false)>]
[<BrowsableAttribute(false)>]
abstract Page : Page with get, set
[<BindableAttribute(false)>]
[<BrowsableAttribute(false)>]
override Page : Page with get, set Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | The control is a Substitution control. |
Examples
The following example overrides the Control
Protected Overrides Sub Render(output As HtmlTextWriter)
output.Write("Welcome to Control Development!<br>")
' Test if the page is loaded for the first time
If Not Page.IsPostBack Then
output.Write("Page has just been loaded")
Else
output.Write("Postback has occured")
End If
End Sub
protected override void Render(HtmlTextWriter output)
{
output.Write("Welcome to Control Development!<br>");
// Test if the page is loaded for the first time
if (!Page.IsPostBack)
output.Write("Page has just been loaded");
else
output.Write("Postback has occured");
}
Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.