Latest web development tutorials

ASP.NET Parent property

Control Standard Properties Reference Control Standard Properties Reference

Definition and Usage

Parent Property Gets a reference to control's parent control.


Examples

The following example shows Parent element contains Button controls:

<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>

The demonstration >>

Control Standard Properties Reference Control Standard Properties Reference