ASP.NET Parent Property

Definition and Usage

The Parent property retrieves a reference to the parent server control.

Example

This example shows the Parent element containing the button control:

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

Example

Parent Element Containing button Control