ASP.NET NamingContainerProperty


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

Definition and Usage

The NamingContainer property gets a reference to the control's naming container, which creates a unique namespace to distinguish controls with the same Control.ID property value.


Example

The following example displays the NamingContainer of a Button control:

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

Show Example »

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