ASP.NET ParentProperties


控件标准属性参考手册Control Standard Attributes Reference Manual

Definition and Usage

The Parent property gets a reference to the parent control of the control.


Example

The following example shows the Parent element that contains 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>

Demo Example »

控件标准属性参考手册Control Standard Attributes Reference Manual Other Extensions