ASP.NET Page Properties

Definition and Usage

The Page property retrieves a reference to the instance of the Page that contains the server control.

The value of this property reflects the name of the .aspx file that contains the server control.

Example

This example shows a Page that contains a button control:

<script runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Write("The Page containing the button is: ")
Response.Write(button1.Page)
End Sub
</script>
<form runat="server" >
<asp:Button ID="button1" OnClick="Button1_Click"
Text="Get Page" runat="server" />
</form>

Example

Display Page with Button Control