Ottiene un riferimento all'istanza Page che contiene il controllo server.
Assembly: System.Web (in System.Web.dll)
<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
| Eccezione | Condizione |
|---|---|
| InvalidOperationException |
Il controllo è un controllo Substitution. |
Il valore di questa proprietà riflette il nome del file ASPX che contiene il controllo server.
Nell'esempio seguente il metodo Control.Render viene sottoposto a override. Viene utilizzata la proprietà Page per accedere alla proprietà Page.IsPostBack e determinare se la pagina che contiene il controllo è stata caricata per la prima volta o se è il risultato di un postback.
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");
}
.NET Framework
Supportato in: 4, 3.5, 3.0, 2.0, 1.1, 1.0Windows 7, Windows Vista SP1 o versione successiva, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (componenti di base del server non supportati), Windows Server 2008 R2 (componenti di base del server supportati con SP1 o versione successiva), Windows Server 2003 SP2
.NET Framework non supporta tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.