ASP.NET Parent 属性
2018-09-27 02:36 更新
ASP.NET Parent 属性
控件标准属性参考手册
定义和用法
Parent 属性获取对控件的父控件的引用。
实例
下面的实例显示包含 Button 控件的 Parent 元素:
<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>
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>
演示实例 »
控件标准属性参考手册
以上内容是否对您有帮助:
更多建议: