ASP.NET NamingContainer 属性
ASP.NET NamingContainer 属性
控件标准属性参考手册
定义和用法
NamingContainer 属性获取对控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 Control.ID 属性值的控件。
实例
下面的实例显示 Button 控件的 NamingContainer:
<script runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Write("The naming container is: ")
Response.Write(button1.NamingContainer)
End Sub
</script>
<form runat="server" >
<asp:Button ID="button1" OnClick="Button1_Click"
Text="Get NamingContainer" runat="server" />
</form>
Sub Button1_Click(sender As Object, e As EventArgs)
Response.Write("The naming container is: ")
Response.Write(button1.NamingContainer)
End Sub
</script>
<form runat="server" >
<asp:Button ID="button1" OnClick="Button1_Click"
Text="Get NamingContainer" runat="server" />
</form>
演示实例 »
控件标准属性参考手册